NeoPZ
|
Implement the interface between TPZGeoMesh and the files produced by Gmsh (version 3.0 or 4.0 ) in msh format. More...
#include <TPZGmshReader.h>
Public Member Functions | |
TPZGmshReader () | |
Default constructor. More... | |
~TPZGmshReader () | |
Default destructor. More... | |
TPZGmshReader (const TPZGmshReader &other) | |
Copy constructor. More... | |
const TPZGmshReader & | operator= (const TPZGmshReader &other) |
Assignement constructor. More... | |
TPZGeoMesh * | GeometricGmshMesh (std::string file_name, TPZGeoMesh *gmesh=NULL) |
Convert Gmsh msh files in a TPZGeoMesh object. More... | |
void | SetCharacteristiclength (REAL length) |
Set the Characteristic length. More... | |
void | SetFormatVersion (std::string format_version) |
Set the format version. More... | |
void | PrintPartitionSummary (std::ostream &out) |
Print the partition summary after the reading process. More... | |
TPZGeoMesh * | GeometricGmshMesh4 (std::string file_name, TPZGeoMesh *gmesh=NULL) |
Convert a Gmsh *.msh file with format 4 to a TPZGeoMesh object. More... | |
void | InsertElement (TPZGeoMesh *gmesh, int &physical_identifier, int &el_type, int &el_identifier, std::vector< int > &node_identifiers) |
int | GetNumberofNodes (int &el_type) |
TPZGeoMesh * | GeometricGmshMesh3 (std::string file_name, TPZGeoMesh *gmesh=NULL) |
Convert a Gmsh *.msh file with format 3 to a TPZGeoMesh object. More... | |
bool | InsertElement (TPZGeoMesh *gmesh, std::ifstream &line) |
Insert elements following msh file format */. More... | |
TPZManVector< std::map< int, std::string >, 4 > & | GetDimPhysicalTagName () |
Get the structure dim - physical tag - name. More... | |
void | SetDimPhysicalTagName (TPZManVector< std::map< int, std::string >, 4 > &dim_physical_tag_and_name) |
Set the structure dim - physical tag - name. More... | |
void | SetDimNamePhysical (TPZManVector< std::map< std::string, int >, 4 > &dim_name_and_physical_tag) |
Get the structure dim - name - physical tag. More... | |
TPZManVector< std::map< std::string, int >, 4 > & | GetDimNamePhysical () |
Get the structure dim - name - physical tag. More... | |
void | GetDimNamePhysical (TPZVec< std::map< std::string, int >> &dim_name_and_physical_tag) |
Get the structure dim - name - physical tag. More... | |
TPZVec< int64_t > & | EntityIndex () |
int | NHexahedra () |
Return the number of hexahedra created. More... | |
int | NTetrahera () |
Return the number of tetrahedra created. More... | |
int | NPrisms () |
Return the number of prisms created. More... | |
int | NPyramids () |
Return the number of pyramids created. More... | |
int | NQuadrilaterals () |
Return the number of quadrilaterals created. More... | |
int | NTriangles () |
Return the number of triangles created. More... | |
int | NLines () |
Return the number of line created. More... | |
int | NPoints () |
Return the number of line created. More... | |
int | Dimension () |
Return the dimension of the mesh. More... | |
Private Attributes | |
std::string | m_format_version |
gmsh file format version (supported versions = {3,4}) More... | |
int | m_n_volumes |
Number of volumes. More... | |
int | m_n_surfaces |
Number of surfaces. More... | |
int | m_n_curves |
Number of curves. More... | |
int | m_n_points |
Number of points. More... | |
int | m_n_physical_volumes |
Number of volumes with physical tag. More... | |
int | m_n_physical_surfaces |
Number of surfaces with physical tag. More... | |
int | m_n_physical_curves |
Number of curves with physical tag. More... | |
int | m_n_physical_points |
Number of points with physical tag. More... | |
int | m_dimension |
Geometry dimension. More... | |
REAL | m_characteristic_lentgh |
Characteristic length to apply a Scale affine transformation. More... | |
TPZManVector< std::map< int, std::vector< int > >, 4 > | m_dim_entity_tag_and_physical_tag |
Data structure of both: physical entities and names indexed by dimension. More... | |
TPZManVector< std::map< int, std::string >, 4 > | m_dim_physical_tag_and_name |
Structure of both: physical entities and names indexed by dimension. More... | |
TPZManVector< std::map< std::string, int >, 4 > | m_dim_name_and_physical_tag |
Structure of both: names and physical id indexed by dimension. More... | |
TPZManVector< std::map< int, int >, 4 > | m_dim_physical_tag_and_physical_tag |
Structure of both: physical id and user defined physical tag indexed by dimension. More... | |
TPZVec< int64_t > | m_entity_index |
Entity index to which the element belongs. More... | |
int | m_n_hexahedron_els |
Number of hexahedra. More... | |
int | m_n_tetrahedron_els |
Number of tetrahedra. More... | |
int | m_n_prism_els |
Number of prisms. More... | |
int | m_n_pyramid_els |
Number of pyramids. More... | |
int | m_n_quadrilateral_els |
Number of quadrilaterals. More... | |
int | m_n_triangle_els |
Number of triangles. More... | |
int | m_n_line_els |
Number of triangles. More... | |
int | m_n_point_els |
Number of points. More... | |
Implement the interface between TPZGeoMesh and the files produced by Gmsh (version 3.0 or 4.0 ) in msh format.
Definition at line 66 of file TPZGmshReader.h.
TPZGmshReader::TPZGmshReader | ( | ) |
Default constructor.
Definition at line 38 of file TPZGmshReader.cpp.
References m_characteristic_lentgh, m_dim_entity_tag_and_physical_tag, m_dim_name_and_physical_tag, m_dim_physical_tag_and_name, m_dim_physical_tag_and_physical_tag, m_dimension, m_entity_index, m_format_version, m_n_curves, m_n_physical_curves, m_n_physical_points, m_n_physical_surfaces, m_n_physical_volumes, m_n_points, m_n_surfaces, m_n_volumes, TPZManVector< T, NumExtAlloc >::Resize(), and TPZVec< T >::Resize().
TPZGmshReader::~TPZGmshReader | ( | ) |
Default destructor.
Definition at line 60 of file TPZGmshReader.cpp.
TPZGmshReader::TPZGmshReader | ( | const TPZGmshReader & | other | ) |
Copy constructor.
Definition at line 113 of file TPZGmshReader.cpp.
References m_characteristic_lentgh, m_dim_entity_tag_and_physical_tag, m_dim_name_and_physical_tag, m_dim_physical_tag_and_name, m_dim_physical_tag_and_physical_tag, m_dimension, m_entity_index, m_format_version, m_n_curves, m_n_physical_curves, m_n_physical_points, m_n_physical_surfaces, m_n_physical_volumes, m_n_points, m_n_surfaces, and m_n_volumes.
|
inline |
Return the dimension of the mesh.
Definition at line 259 of file TPZGmshReader.h.
|
inline |
Definition at line 213 of file TPZGmshReader.h.
TPZGeoMesh * TPZGmshReader::GeometricGmshMesh | ( | std::string | file_name, |
TPZGeoMesh * | gmesh = NULL |
||
) |
Convert Gmsh msh files in a TPZGeoMesh object.
Definition at line 64 of file TPZGmshReader.cpp.
References DebugStop, GeometricGmshMesh3(), GeometricGmshMesh4(), and m_format_version.
TPZGeoMesh * TPZGmshReader::GeometricGmshMesh3 | ( | std::string | file_name, |
TPZGeoMesh * | gmesh = NULL |
||
) |
Convert a Gmsh *.msh file with format 3 to a TPZGeoMesh object.
Definition at line 691 of file TPZGmshReader.cpp.
References TPZGeoMesh::BuildConnectivity(), DebugStop, dimension, TPZVec< T >::end(), InsertElement(), m_characteristic_lentgh, m_dim_name_and_physical_tag, m_dim_physical_tag_and_name, m_dim_physical_tag_and_physical_tag, TPZGeoMesh::NElements(), TPZGeoMesh::NNodes(), TPZGeoMesh::NodeVec(), stats::read(), TPZGeoMesh::SetDimension(), TPZGeoMesh::SetMaxElementId(), and TPZGeoMesh::SetMaxNodeId().
Referenced by GeometricGmshMesh(), and PYBIND11_MODULE().
TPZGeoMesh * TPZGmshReader::GeometricGmshMesh4 | ( | std::string | file_name, |
TPZGeoMesh * | gmesh = NULL |
||
) |
Convert a Gmsh *.msh file with format 4 to a TPZGeoMesh object.
Entity bounding box data
Internally the nodes index and element index is converted to zero based indexation
Definition at line 157 of file TPZGmshReader.cpp.
References TPZGeoMesh::BuildConnectivity(), DebugStop, dimension, TPZVec< T >::end(), GetNumberofNodes(), i_dim(), InsertElement(), m_characteristic_lentgh, m_dim_entity_tag_and_physical_tag, m_dim_name_and_physical_tag, m_dim_physical_tag_and_name, m_dim_physical_tag_and_physical_tag, m_dimension, m_n_curves, m_n_physical_curves, m_n_physical_points, m_n_physical_surfaces, m_n_physical_volumes, m_n_points, m_n_surfaces, m_n_volumes, TPZGeoMesh::NElements(), TPZGeoMesh::NNodes(), TPZGeoMesh::NodeVec(), stats::read(), TPZGeoMesh::SetDimension(), TPZGeoMesh::SetMaxElementId(), TPZGeoMesh::SetMaxNodeId(), and TPZVec< T >::size().
Referenced by GeometricGmshMesh(), and PYBIND11_MODULE().
|
inline |
Get the structure dim - name - physical tag.
Definition at line 204 of file TPZGmshReader.h.
|
inline |
Get the structure dim - name - physical tag.
Definition at line 209 of file TPZGmshReader.h.
|
inline |
Get the structure dim - physical tag - name.
Definition at line 188 of file TPZGmshReader.h.
int TPZGmshReader::GetNumberofNodes | ( | int & | el_type | ) |
Definition at line 592 of file TPZGmshReader.cpp.
References DebugStop.
Referenced by GeometricGmshMesh4().
void TPZGmshReader::InsertElement | ( | TPZGeoMesh * | gmesh, |
int & | physical_identifier, | ||
int & | el_type, | ||
int & | el_identifier, | ||
std::vector< int > & | node_identifiers | ||
) |
Gmsh representation Quadrangle8 and Quadrangle9, but by default Quadrangle9 is always generated. (?_?).
Definition at line 467 of file TPZGmshReader.cpp.
References DebugStop, m_n_hexahedron_els, m_n_line_els, m_n_point_els, m_n_prism_els, m_n_pyramid_els, m_n_quadrilateral_els, m_n_tetrahedron_els, m_n_triangle_els, TPZManVector< T, NumExtAlloc >::Resize(), and TPZVec< T >::size().
Referenced by GeometricGmshMesh3(), and GeometricGmshMesh4().
bool TPZGmshReader::InsertElement | ( | TPZGeoMesh * | gmesh, |
std::ifstream & | line | ||
) |
Insert elements following msh file format */.
Insert elements following msh file format.
Definition at line 869 of file TPZGmshReader.cpp.
References DebugStop, dimension, m_dim_physical_tag_and_physical_tag, m_entity_index, TPZVec< T >::Resize(), and TPZGeoMesh::SetDimension().
|
inline |
Return the number of hexahedra created.
Definition at line 219 of file TPZGmshReader.h.
|
inline |
Return the number of line created.
Definition at line 249 of file TPZGmshReader.h.
|
inline |
Return the number of line created.
Definition at line 254 of file TPZGmshReader.h.
|
inline |
Return the number of prisms created.
Definition at line 229 of file TPZGmshReader.h.
|
inline |
Return the number of pyramids created.
Definition at line 234 of file TPZGmshReader.h.
|
inline |
Return the number of quadrilaterals created.
Definition at line 239 of file TPZGmshReader.h.
|
inline |
Return the number of tetrahedra created.
Definition at line 224 of file TPZGmshReader.h.
|
inline |
Return the number of triangles created.
Definition at line 244 of file TPZGmshReader.h.
const TPZGmshReader & TPZGmshReader::operator= | ( | const TPZGmshReader & | other | ) |
Assignement constructor.
Assignement constructo{.
check for self-assignment
Definition at line 133 of file TPZGmshReader.cpp.
References m_characteristic_lentgh, m_dim_entity_tag_and_physical_tag, m_dim_name_and_physical_tag, m_dim_physical_tag_and_name, m_dim_physical_tag_and_physical_tag, m_dimension, m_entity_index, m_format_version, m_n_curves, m_n_physical_curves, m_n_physical_points, m_n_physical_surfaces, m_n_physical_volumes, m_n_points, m_n_surfaces, and m_n_volumes.
void TPZGmshReader::PrintPartitionSummary | ( | std::ostream & | out | ) |
Print the partition summary after the reading process.
Definition at line 78 of file TPZGmshReader.cpp.
References m_characteristic_lentgh, m_dimension, m_format_version, m_n_curves, m_n_hexahedron_els, m_n_line_els, m_n_physical_curves, m_n_physical_points, m_n_physical_surfaces, m_n_physical_volumes, m_n_point_els, m_n_points, m_n_prism_els, m_n_pyramid_els, m_n_quadrilateral_els, m_n_surfaces, m_n_tetrahedron_els, m_n_triangle_els, and m_n_volumes.
void TPZGmshReader::SetCharacteristiclength | ( | REAL | length | ) |
Set the Characteristic length.
Definition at line 858 of file TPZGmshReader.cpp.
References m_characteristic_lentgh.
|
inline |
Get the structure dim - name - physical tag.
Definition at line 198 of file TPZGmshReader.h.
|
inline |
Set the structure dim - physical tag - name.
Definition at line 193 of file TPZGmshReader.h.
void TPZGmshReader::SetFormatVersion | ( | std::string | format_version | ) |
Set the format version.
Definition at line 863 of file TPZGmshReader.cpp.
References m_format_version.
|
private |
Characteristic length to apply a Scale affine transformation.
Definition at line 99 of file TPZGmshReader.h.
Referenced by GeometricGmshMesh3(), GeometricGmshMesh4(), operator=(), PrintPartitionSummary(), SetCharacteristiclength(), and TPZGmshReader().
|
private |
Data structure of both: physical entities and names indexed by dimension.
Definition at line 104 of file TPZGmshReader.h.
Referenced by GeometricGmshMesh4(), operator=(), and TPZGmshReader().
|
private |
Structure of both: names and physical id indexed by dimension.
Definition at line 112 of file TPZGmshReader.h.
Referenced by GeometricGmshMesh3(), GeometricGmshMesh4(), operator=(), and TPZGmshReader().
|
private |
Structure of both: physical entities and names indexed by dimension.
Definition at line 109 of file TPZGmshReader.h.
Referenced by GeometricGmshMesh3(), GeometricGmshMesh4(), operator=(), and TPZGmshReader().
|
private |
Structure of both: physical id and user defined physical tag indexed by dimension.
Definition at line 115 of file TPZGmshReader.h.
Referenced by GeometricGmshMesh3(), GeometricGmshMesh4(), InsertElement(), operator=(), and TPZGmshReader().
|
private |
Geometry dimension.
Definition at line 96 of file TPZGmshReader.h.
Referenced by GeometricGmshMesh4(), operator=(), PrintPartitionSummary(), and TPZGmshReader().
|
private |
Entity index to which the element belongs.
Definition at line 118 of file TPZGmshReader.h.
Referenced by InsertElement(), operator=(), and TPZGmshReader().
|
private |
gmsh file format version (supported versions = {3,4})
Definition at line 69 of file TPZGmshReader.h.
Referenced by GeometricGmshMesh(), operator=(), PrintPartitionSummary(), SetFormatVersion(), and TPZGmshReader().
|
private |
Number of curves.
Definition at line 78 of file TPZGmshReader.h.
Referenced by GeometricGmshMesh4(), operator=(), PrintPartitionSummary(), and TPZGmshReader().
|
private |
Number of hexahedra.
Definition at line 121 of file TPZGmshReader.h.
Referenced by InsertElement(), and PrintPartitionSummary().
|
private |
Number of triangles.
Definition at line 139 of file TPZGmshReader.h.
Referenced by InsertElement(), and PrintPartitionSummary().
|
private |
Number of curves with physical tag.
Definition at line 90 of file TPZGmshReader.h.
Referenced by GeometricGmshMesh4(), operator=(), PrintPartitionSummary(), and TPZGmshReader().
|
private |
Number of points with physical tag.
Definition at line 93 of file TPZGmshReader.h.
Referenced by GeometricGmshMesh4(), operator=(), PrintPartitionSummary(), and TPZGmshReader().
|
private |
Number of surfaces with physical tag.
Definition at line 87 of file TPZGmshReader.h.
Referenced by GeometricGmshMesh4(), operator=(), PrintPartitionSummary(), and TPZGmshReader().
|
private |
Number of volumes with physical tag.
Definition at line 84 of file TPZGmshReader.h.
Referenced by GeometricGmshMesh4(), operator=(), PrintPartitionSummary(), and TPZGmshReader().
|
private |
Number of points.
Definition at line 142 of file TPZGmshReader.h.
Referenced by InsertElement(), and PrintPartitionSummary().
|
private |
Number of points.
Definition at line 81 of file TPZGmshReader.h.
Referenced by GeometricGmshMesh4(), operator=(), PrintPartitionSummary(), and TPZGmshReader().
|
private |
Number of prisms.
Definition at line 127 of file TPZGmshReader.h.
Referenced by InsertElement(), and PrintPartitionSummary().
|
private |
Number of pyramids.
Definition at line 130 of file TPZGmshReader.h.
Referenced by InsertElement(), and PrintPartitionSummary().
|
private |
Number of quadrilaterals.
Definition at line 133 of file TPZGmshReader.h.
Referenced by InsertElement(), and PrintPartitionSummary().
|
private |
Number of surfaces.
Definition at line 75 of file TPZGmshReader.h.
Referenced by GeometricGmshMesh4(), operator=(), PrintPartitionSummary(), and TPZGmshReader().
|
private |
Number of tetrahedra.
Definition at line 124 of file TPZGmshReader.h.
Referenced by InsertElement(), and PrintPartitionSummary().
|
private |
Number of triangles.
Definition at line 136 of file TPZGmshReader.h.
Referenced by InsertElement(), and PrintPartitionSummary().
|
private |
Number of volumes.
Definition at line 72 of file TPZGmshReader.h.
Referenced by GeometricGmshMesh4(), operator=(), PrintPartitionSummary(), and TPZGmshReader().