GmshMeshReader< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <GmshMeshReader.hpp>

Inherits AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Collaboration diagram for GmshMeshReader< ELEMENT_DIM, SPACE_DIM >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 GmshMeshReader (std::string pathBaseName, unsigned orderOfElements=1, unsigned orderOfBoundaryElements=1)
 ~GmshMeshReader ()
unsigned GetNumElements () const
unsigned GetNumNodes () const
unsigned GetNumFaces () const
unsigned GetNumCableElements () const
unsigned GetNumElementAttributes () const
unsigned GetNumFaceAttributes () const
unsigned GetNumCableElementAttributes () const
unsigned GetOrderOfElements ()
unsigned GetOrderOfBoundaryElements ()
void Reset ()
std::vector< doubleGetNextNode ()
ElementData GetNextElementData ()
ElementData GetNextFaceData ()
ElementData GetNextCableElementData ()
std::vector< doubleGetNodeAttributes ()
std::vector< doubleGetNode (unsigned index)
ElementData GetElementData (unsigned index)
ElementData GetFaceData (unsigned index)

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 mNumElementAttributes
unsigned mNumFaceAttributes
unsigned mOrderOfElements
unsigned mOrderOfBoundaryElements
unsigned mNodesPerElement
unsigned mNodesPerBoundaryElement

Detailed Description

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
class GmshMeshReader< ELEMENT_DIM, SPACE_DIM >

Class to enable reading of Gmsh format mesh files (see #2312).

Definition at line 68 of file GmshMeshReader.hpp.


Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GmshMeshReader ( std::string  pathBaseName,
unsigned  orderOfElements = 1,
unsigned  orderOfBoundaryElements = 1 
) [inline]

Constructor.

Parameters:
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().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::~GmshMeshReader (  )  [inline]

Destructor

Definition at line 78 of file GmshMeshReader.cpp.

References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::CloseFiles().


Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::CloseFiles (  )  [inline, private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ElementData GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetElementData ( unsigned  index  )  [inline, virtual]

Normally throws an exception. Only implemented for tetrahedral mesh reader of binary files.

Parameters:
index The global element index
Returns:
a vector of the node indices of the element (and any attribute information, if there is any)

Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 454 of file GmshMeshReader.cpp.

References NEVER_REACHED.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ElementData GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetFaceData ( unsigned  index  )  [inline, virtual]

Normally throws an exception. Only implemented for tetrahedral mesh reader of binary files.

Parameters:
index The global face index
Returns:
a vector of the node indices of the face (and any attribute/containment information, if there is any)

Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 460 of file GmshMeshReader.cpp.

References NEVER_REACHED.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ElementData GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextCableElementData (  )  [inline, virtual]
Returns:
a vector of the node indices of each cable element (and any attribute information, if there is any) in turn

Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 388 of file GmshMeshReader.cpp.

References NEVER_REACHED.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ElementData GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData (  )  [inline, virtual]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ElementData GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextFaceData (  )  [inline, virtual]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< double > GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextNode (  )  [inline, virtual]
Returns:
a vector of the coordinates of each node in turn

Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 307 of file GmshMeshReader.cpp.

References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodeFile.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< double > GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNode ( unsigned  index  )  [inline, virtual]

Normally throws an exception. Only implemented for tetrahedral mesh reader of binary files.

Parameters:
index The global node index
Returns:
a vector of the coordinates of the node

Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 448 of file GmshMeshReader.cpp.

References NEVER_REACHED.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< double > GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNodeAttributes (  )  [inline, virtual]
Returns:
the vector of node attributes

Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 328 of file GmshMeshReader.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumCableElementAttributes (  )  const [inline, virtual]
Returns:
the number of cable element attributes in the mesh

Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 290 of file GmshMeshReader.cpp.

References NEVER_REACHED.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumCableElements (  )  const [inline, virtual]
Returns:
the number of cable elements in the mesh

Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 259 of file GmshMeshReader.cpp.

References NEVER_REACHED.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElementAttributes (  )  const [inline, virtual]
Returns:
the number of attributes in the mesh

Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 278 of file GmshMeshReader.cpp.

References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElementAttributes.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElements (  )  const [inline, virtual]
Returns:
the number of elements in the mesh

Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 241 of file GmshMeshReader.cpp.

References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElements.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumFaceAttributes (  )  const [inline, virtual]
Returns:
the number of attributes in the mesh

Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 284 of file GmshMeshReader.cpp.

References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaceAttributes.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumFaces (  )  const [inline, virtual]
Returns:
the number of faces in the mesh (synonym of GetNumEdges())

Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 253 of file GmshMeshReader.cpp.

References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaces.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumNodes (  )  const [inline, virtual]
Returns:
the number of nodes in the mesh

Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 247 of file GmshMeshReader.cpp.

References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodes.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetOrderOfBoundaryElements (  )  [inline, virtual]
Returns:
the expected order of the element file (1=linear, 2=quadratic)

Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 272 of file GmshMeshReader.cpp.

References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mOrderOfBoundaryElements.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetOrderOfElements (  )  [inline, virtual]

*

Returns:
the expected order of the element file (1=linear, 2=quadratic)

Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 266 of file GmshMeshReader.cpp.

References GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mOrderOfElements.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenFiles (  )  [inline, private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadElementHeader (  )  [inline, private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadFaceHeader (  )  [inline, private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders (  )  [inline, private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadNodeHeader (  )  [inline, private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset (  )  [inline, virtual]

Member Data Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mDataSize [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().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::ifstream GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementFile [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::ifstream GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mFaceFile [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::string GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mFileName [private]

The name of the mesh file.

Definition at line 180 of file GmshMeshReader.hpp.

Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::OpenFiles().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mFileType [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().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::ifstream GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodeFile [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesPerBoundaryElement [private]

The number of nodes contained in each boundary element.

Definition at line 195 of file GmshMeshReader.hpp.

Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextFaceData(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GmshMeshReader().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesPerElement [private]

The number of nodes contained in each element.

Definition at line 194 of file GmshMeshReader.hpp.

Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GmshMeshReader().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElementAttributes [private]

Is the number of attributes stored for each element.

Definition at line 190 of file GmshMeshReader.hpp.

Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElementAttributes().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElements [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaceAttributes [private]

Is the number of attributes stored for each face.

Definition at line 191 of file GmshMeshReader.hpp.

Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextFaceData(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumFaceAttributes().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaces [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodes [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mOrderOfBoundaryElements [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 >::GetOrderOfBoundaryElements(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GmshMeshReader().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mOrderOfElements [private]

The order of each element (1 for linear, 2 for quadratic).

Definition at line 192 of file GmshMeshReader.hpp.

Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GetOrderOfElements(), and GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::GmshMeshReader().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::mVersionNumber [private]

The version number of the file.

Definition at line 184 of file GmshMeshReader.hpp.

Referenced by GmshMeshReader< ELEMENT_DIM, SPACE_DIM >::ReadHeaders().


The documentation for this class was generated from the following files:

Generated by  doxygen 1.6.2