Chaste
Release::2017.1
|
#include <GmshMeshReader.hpp>
Private Member Functions | |
void | ReadHeaders () |
void | ReadNodeHeader () |
void | ReadElementHeader () |
void | ReadFaceHeader () |
void | OpenFiles () |
void | CloseFiles () |
Private Attributes | |
std::string | mFileName |
std::ifstream | mNodeFile |
std::ifstream | mElementFile |
std::ifstream | mFaceFile |
double | mVersionNumber |
unsigned | mFileType |
unsigned | mDataSize |
unsigned | mNumNodes |
unsigned | mNumElements |
unsigned | mNumFaces |
unsigned | mTotalNumElementsAndFaces |
unsigned | mNumElementAttributes |
unsigned | mNumFaceAttributes |
unsigned | mOrderOfElements |
unsigned | mOrderOfBoundaryElements |
unsigned | mNodesPerElement |
unsigned | mNodesPerBoundaryElement |
Class to enable reading of Gmsh format mesh files (see #2312).
Definition at line 68 of file GmshMeshReader.hpp.
GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GmshMeshReader | ( | std::string | pathBaseName, |
unsigned | orderOfElements = 1 , |
||
unsigned | orderOfBoundaryElements = 1 |
||
) |
Constructor.
pathBaseName | the base name of the files from which to read the mesh data (either absolute, or relative to the current directory) |
orderOfElements | the order of each element: 1 for linear, 2 for quadratic (defaults to 1) |
orderOfBoundaryElements | the order of each boundary element: 1 for linear, 2 for quadratic (defaults to 1. May or may not be different to orderOfElements |
Definition at line 43 of file GmshMeshReader.cpp.
References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesPerBoundaryElement, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesPerElement, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mOrderOfBoundaryElements, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mOrderOfElements, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenFiles(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().
GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::~GmshMeshReader | ( | ) |
Destructor
Definition at line 76 of file GmshMeshReader.cpp.
References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::CloseFiles().
|
private |
Closes the .msh file descriptors
Definition at line 95 of file GmshMeshReader.cpp.
References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementFile, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mFaceFile, and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodeFile.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::~GmshMeshReader().
|
virtual |
Normally throws an exception. Only implemented for tetrahedral mesh reader of binary files.
index | The global element index |
Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 472 of file GmshMeshReader.cpp.
References NEVER_REACHED.
|
virtual |
Normally throws an exception. Only implemented for tetrahedral mesh reader of binary files.
index | The global face index |
Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 480 of file GmshMeshReader.cpp.
References NEVER_REACHED.
|
virtual |
Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 402 of file GmshMeshReader.cpp.
References NEVER_REACHED.
|
virtual |
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 347 of file GmshMeshReader.cpp.
References ElementData::AttributeValue, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementFile, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesPerElement, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElementAttributes, and ElementData::NodeIndices.
|
virtual |
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 409 of file GmshMeshReader.cpp.
References ElementData::AttributeValue, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mFaceFile, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesPerBoundaryElement, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaceAttributes, and ElementData::NodeIndices.
|
virtual |
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 320 of file GmshMeshReader.cpp.
References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodeFile.
|
virtual |
Normally throws an exception. Only implemented for tetrahedral mesh reader of binary files.
index | The global node index |
Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 464 of file GmshMeshReader.cpp.
References NEVER_REACHED.
|
virtual |
Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 341 of file GmshMeshReader.cpp.
|
virtual |
Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 303 of file GmshMeshReader.cpp.
References NEVER_REACHED.
|
virtual |
Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 270 of file GmshMeshReader.cpp.
References NEVER_REACHED.
|
virtual |
Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 290 of file GmshMeshReader.cpp.
References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElementAttributes.
|
virtual |
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 251 of file GmshMeshReader.cpp.
References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElements.
|
virtual |
Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 296 of file GmshMeshReader.cpp.
References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaceAttributes.
|
virtual |
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 263 of file GmshMeshReader.cpp.
References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaces.
|
virtual |
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 257 of file GmshMeshReader.cpp.
References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodes.
|
virtual |
Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 284 of file GmshMeshReader.cpp.
References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mOrderOfBoundaryElements.
|
virtual |
*
Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 278 of file GmshMeshReader.cpp.
References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mOrderOfElements.
|
private |
Opens the .msh file descriptors
Definition at line 82 of file GmshMeshReader.cpp.
References EXCEPTION, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementFile, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mFaceFile, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mFileName, and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodeFile.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GmshMeshReader(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset().
|
private |
Read the element header from the mesh file.
Definition at line 164 of file GmshMeshReader.cpp.
References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementFile, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElements, and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mTotalNumElementsAndFaces.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().
|
private |
Read the face header from the mesh file.
Definition at line 209 of file GmshMeshReader.cpp.
References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mFaceFile, and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaces.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().
|
private |
Read all the header information from the mesh file.
Definition at line 103 of file GmshMeshReader.cpp.
References EXCEPTION, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mDataSize, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mFileType, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodeFile, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElements, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaces, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mTotalNumElementsAndFaces, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mVersionNumber, GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadElementHeader(), GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadFaceHeader(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadNodeHeader().
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GmshMeshReader(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset().
|
private |
Read the node header from the mesh file.
Definition at line 146 of file GmshMeshReader.cpp.
References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodeFile, and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodes.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().
|
virtual |
Resets pointers to beginning
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 311 of file GmshMeshReader.cpp.
References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::CloseFiles(), GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenFiles(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().
|
private |
The number of floating point numbers in the file
Definition at line 186 of file GmshMeshReader.hpp.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().
|
private |
A file stream used to read the volume elements of the file.
Definition at line 182 of file GmshMeshReader.hpp.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::CloseFiles(), GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData(), GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenFiles(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadElementHeader().
|
private |
A file stream used to read the boundary elements of the file.
Definition at line 183 of file GmshMeshReader.hpp.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::CloseFiles(), GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextFaceData(), GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenFiles(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadFaceHeader().
|
private |
The name of the mesh file.
Definition at line 180 of file GmshMeshReader.hpp.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenFiles().
|
private |
The type of the mesh file being read (should always be 0)
Definition at line 185 of file GmshMeshReader.hpp.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().
|
private |
A file stream used to read the node (and header) part of the file.
Definition at line 181 of file GmshMeshReader.hpp.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::CloseFiles(), GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextNode(), GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenFiles(), GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadNodeHeader().
|
private |
The number of nodes contained in each boundary element.
Definition at line 196 of file GmshMeshReader.hpp.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextFaceData(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GmshMeshReader().
|
private |
The number of nodes contained in each element.
Definition at line 195 of file GmshMeshReader.hpp.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GmshMeshReader().
|
private |
Is the number of attributes stored for each element.
Definition at line 191 of file GmshMeshReader.hpp.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElementAttributes().
|
private |
Number of elements in the mesh.
Definition at line 188 of file GmshMeshReader.hpp.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElements(), GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadElementHeader(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().
|
private |
Is the number of attributes stored for each face.
Definition at line 192 of file GmshMeshReader.hpp.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextFaceData(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumFaceAttributes().
|
private |
Number of faces in the mesh.
Definition at line 189 of file GmshMeshReader.hpp.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumFaces(), GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadFaceHeader(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().
|
private |
Number of nodes in the mesh.
Definition at line 187 of file GmshMeshReader.hpp.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadNodeHeader().
|
private |
The order of each element (1 for linear, 2 for quadratic).
Definition at line 194 of file GmshMeshReader.hpp.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetOrderOfBoundaryElements(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GmshMeshReader().
|
private |
The order of each element (1 for linear, 2 for quadratic).
Definition at line 193 of file GmshMeshReader.hpp.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetOrderOfElements(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GmshMeshReader().
|
private |
Total number of elements and faces in the mesh.
Definition at line 190 of file GmshMeshReader.hpp.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadElementHeader(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().
|
private |
The version number of the file.
Definition at line 184 of file GmshMeshReader.hpp.
Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().