Bembel
Geometry

This module handles all geometry related concerns. More...

Classes

class  Bembel::Geometry
 this class wraps a GeometryVector and provides some basic functionality, like reading Geometry files More...
 
class  Bembel::Patch
 handles a single patch More...
 

Typedefs

typedef std::vector< Bembel::PatchBembel::PatchVector
 typedef for PatchVector More...
 
typedef Eigen::Matrix< double, 12, 1 > SurfacePoint
 typedef of SurfacePoint More...
 
typedef std::vector< SurfacePoint, Eigen::aligned_allocator< SurfacePoint > > ElementSurfacePoints
 typedef std::vector<SurfacePoint> with aligned allocator of Eigen for compatibility with older compilers.
 

Functions

std::vector< PatchBembel::LoadGeometryFileIGS (const std::string &file_name) noexcept
 loads geometry from IGES file. Note that the direction of the normals must be consistent. More...
 
void Bembel::writeSection (std::string file_name, const std::vector< std::string > &section, const char section_char)
 This function writes a given section to the specified file. More...
 
int Bembel::writeParameterSection (std::string file_name, const std::vector< std::string > &section, const int patch_idx, const int start_count)
 This function writes a the parameter section of the IGES file. More...
 
std::vector< std::string > Bembel::makeSection (std::vector< std::string > data, const int linewidth=72)
 Transform a vector of Data in a vector of lines with a specific length. More...
 
void Bembel::writeIGSHeader (std::string file_name)
 Write the IGES header into the given file. More...
 
int Bembel::writeGlobalSection (std::string file_name)
 Write the IGES Global section into the given file. More...
 
int Bembel::writeDirectory (std::string file_name, std::vector< int > start_idx, std::vector< int > number_of_lines)
 Write the IGES Directory section into the given file. More...
 
std::vector< std::string > Bembel::writePatchData (const Patch &patch, const int precision)
 This Function writes the patch from Bembel into a vector which can be written into an IGES file. More...
 
void Bembel::writeIGSFile (const std::vector< Patch > &geometry, std::string file_name, const int precision=6)
 Writes Geometry into an IGES file format. More...
 
std::vector< PatchBembel::LoadGeometryFileDAT (const std::string &file_name) noexcept
 loads geometry from file with GEOPDE-format. Note that the direction of the normals must be consistent More...
 
void Bembel::WriteDATFile (const std::vector< Patch > &Geometry, const std::string &file_name)
 exports a geometry from Bembel to a .dat file. More...
 

Detailed Description

This module handles all geometry related concerns.

The Geometry class is the interface between geometry description and the remainder of the code. We provide an implementation of NURBS discretized patches via the Patch class, but the code is easily extensible to other parametric descriptions mapping from [0,1]2 to parts of the geometry, as long as the corresponding methods for point evaluation and evaluation of the point wise Jacobian are implemented.

Typedef Documentation

◆ PatchVector

typedef std::vector<Bembel::Patch> Bembel::PatchVector

typedef for PatchVector

This is the default geometry format. If custom parametric mappings were to be implemented, one would need to change Bembel::Patch here to the new format, and the new format must provide an eval(), evalNorma(), evalJacobian() and updateSurfacePoint() method.

Definition at line 24 of file PatchVector.hpp.

◆ SurfacePoint

typedef Eigen::Matrix<double, 12, 1> SurfacePoint

typedef of SurfacePoint

This typedef is essential for any evaluation of a bilinear form. It provides all required geometry information, stored as follows: (0) x-coordinate of the evaluation point in the parameter domain [0,1]^2 of the current element, i.e we map [0,1]^2->element->surface (1) y-coordinate of the evaluation point in the parameter domain [0,1]^2 of the current element, i.e we map [0,1]^2->element->surface (2) a quadrature weight. Can be left empty if not used as part of a quadrature. (3) x-coordinate of patch eval in space (4) y-coordinate of patch eval in space (5) z-coordinate of patch eval in space (6) x-component of derivative in x-dir (7) y-component of derivative in x-dir (8) z-component of derivative in x-dir (9) x-component of derivative in y-dir (10) y-component of derivative in y-dir (11) z-component of derivative in y-dir For application of the pull-back to the reference domain, one requires the jacobian of any point on the surface. Calling eval and evalJacobian of the Patch class introduces work that needs to be done twice. The updateSurdacePoint method is specialized and should be used, since it avoids redundant work.

Definition at line 42 of file SurfacePoint.hpp.

Function Documentation

◆ LoadGeometryFileDAT()

std::vector<Patch> Bembel::LoadGeometryFileDAT ( const std::string &  file_name)
inlinenoexcept

loads geometry from file with GEOPDE-format. Note that the direction of the normals must be consistent

Parameters
file_namepath/filename pointing to the geometry file
Returns
std::vector of NURBS::Patch describing geometry

Definition at line 25 of file GeometryIO.hpp.

◆ LoadGeometryFileIGS()

std::vector<Patch> Bembel::LoadGeometryFileIGS ( const std::string &  file_name)
noexcept

loads geometry from IGES file. Note that the direction of the normals must be consistent.

Parameters
file_namepath/filename pointing to the geometry file
Returns
std::vector of NURBS::Patch describing geometry

Definition at line 25 of file GeometryIGS.hpp.

◆ makeSection()

std::vector<std::string> Bembel::makeSection ( std::vector< std::string >  data,
const int  linewidth = 72 
)

Transform a vector of Data in a vector of lines with a specific length.

Parameters
datavector containing the entries written to the section
linewidthMaximum length of the lines
Returns
Vector with strings of each line.

Definition at line 205 of file GeometryIGS.hpp.

◆ WriteDATFile()

void Bembel::WriteDATFile ( const std::vector< Patch > &  Geometry,
const std::string &  file_name 
)

exports a geometry from Bembel to a .dat file.

Limitation: This functions assumes a p-open knot vector without internal knots.

Parameters
Geometrystd::vector of NURBS::Patch describing geometry
file_namepath/filename to be written to

Definition at line 204 of file GeometryIO.hpp.

◆ writeDirectory()

int Bembel::writeDirectory ( std::string  file_name,
std::vector< int >  start_idx,
std::vector< int >  number_of_lines 
)

Write the IGES Directory section into the given file.

Parameters
file_nameFile name to write the section in.
start_idxVector containing the start lines of the sections.
number_of_linesVector containing the lengths of the sections.
Returns
Number of lines of this section.

Definition at line 336 of file GeometryIGS.hpp.

◆ writeGlobalSection()

int Bembel::writeGlobalSection ( std::string  file_name)

Write the IGES Global section into the given file.

Parameters
file_nameFile name to write the section in.
Returns
Number of lines of this section.

Definition at line 265 of file GeometryIGS.hpp.

◆ writeIGSFile()

void Bembel::writeIGSFile ( const std::vector< Patch > &  geometry,
std::string  file_name,
const int  precision = 6 
)

Writes Geometry into an IGES file format.

Parameters
geometryPatchVector which is written to the file.
file_nameFile name to write to.
precisionSignificant number of digits for writing floats.

Definition at line 481 of file GeometryIGS.hpp.

◆ writeIGSHeader()

void Bembel::writeIGSHeader ( std::string  file_name)

Write the IGES header into the given file.

Parameters
file_nameFile name to write the header in.

Definition at line 236 of file GeometryIGS.hpp.

◆ writeParameterSection()

int Bembel::writeParameterSection ( std::string  file_name,
const std::vector< std::string > &  section,
const int  patch_idx,
const int  start_count 
)

This function writes a the parameter section of the IGES file.

Parameters
file_namepath/filename pointing to the geometry file
sectionvector containing the lines to be written to the file
patch_idxindex counting in uneven number
start_countStart counting the lines with this index
Returns
Last index of the line

Definition at line 181 of file GeometryIGS.hpp.

◆ writePatchData()

std::vector<std::string> Bembel::writePatchData ( const Patch patch,
const int  precision 
)

This Function writes the patch from Bembel into a vector which can be written into an IGES file.

This function assumes that the patch knot vectors do not contains internal nodes.

Parameters
patchBembel patch containing all information
precisionNumber of significant digits to save floats
Returns
Vector with patch data in IGES format.

Definition at line 385 of file GeometryIGS.hpp.

◆ writeSection()

void Bembel::writeSection ( std::string  file_name,
const std::vector< std::string > &  section,
const char  section_char 
)

This function writes a given section to the specified file.

Parameters
file_namepath/filename pointing to the geometry file
sectionvector containing the lines to be written to the file
section_charchar to describe the section. Use 'S', 'G' or 'D'

Definition at line 158 of file GeometryIGS.hpp.