Chaste Commit::f2ff7ee04e70ac9d06c57344df8d017dbb12b97b
AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > Class Template Referenceabstract

#include <AbstractMeshReader.hpp>

+ Inheritance diagram for AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >:
+ Collaboration diagram for AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >:

Classes

class  ElementIterator
 
class  NodeIterator
 

Public Member Functions

virtual unsigned GetNumElements () const =0
 
virtual unsigned GetNumNodes () const =0
 
virtual unsigned GetNumFaces () const =0
 
virtual unsigned GetNumCableElements () const
 
virtual unsigned GetNumElementAttributes () const
 
virtual unsigned GetNumFaceAttributes () const
 
virtual unsigned GetNumCableElementAttributes () const
 
virtual std::vector< doubleGetNodeAttributes ()
 
unsigned GetNumEdges () const
 
virtual std::vector< doubleGetNextNode ()=0
 
virtual void Reset ()=0
 
virtual ElementData GetNextElementData ()=0
 
virtual ElementData GetNextFaceData ()=0
 
virtual ElementData GetNextCableElementData ()
 
ElementData GetNextEdgeData ()
 
virtual std::vector< doubleGetNode (unsigned index)
 
virtual ElementData GetElementData (unsigned index)
 
virtual ElementData GetFaceData (unsigned index)
 
ElementData GetEdgeData (unsigned index)
 
virtual std::vector< unsignedGetContainingElementIndices (unsigned index)
 
virtual std::string GetMeshFileBaseName ()
 
virtual unsigned GetOrderOfElements ()
 
virtual unsigned GetOrderOfBoundaryElements ()
 
virtual bool GetReadContainingElementOfBoundaryElement ()
 
virtual bool IsFileFormatBinary ()
 
virtual bool HasNclFile ()
 
virtual bool HasNodePermutation ()
 
virtual const std::vector< unsigned > & rGetNodePermutation ()
 
ElementIterator GetElementIteratorBegin ()
 
ElementIterator GetElementIteratorBegin (const std::set< unsigned > &rIndices)
 
ElementIterator GetElementIteratorEnd ()
 
NodeIterator GetNodeIteratorBegin ()
 
NodeIterator GetNodeIteratorBegin (const std::set< unsigned > &rIndices)
 
NodeIterator GetNodeIteratorEnd ()
 

Detailed Description

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

An abstract mesh reader class. Reads output generated by a mesh generator and converts it to a standard format for use in constructing a finite element mesh structure.

A derived class TrianglesMeshReader exists for reading meshes generated by Triangles (in 2-d) and TetGen (in 3-d).

A derived class MemfemMeshReader reads 3D data from the Tulane University code

A derived class FemlabMeshReader reads 2D data from Femlab or Matlab PDEToolbox

Definition at line 76 of file AbstractMeshReader.hpp.

Constructor & Destructor Documentation

◆ ~AbstractMeshReader()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
virtual AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::~AbstractMeshReader ( )
inlinevirtual

Definition at line 81 of file AbstractMeshReader.hpp.

Member Function Documentation

◆ GetContainingElementIndices()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< unsigned > AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetContainingElementIndices ( unsigned  index)
virtual

Normally throws an exception. When implemented by derived classes, returns a list of the elements that contain the node (only available for binary files).

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

Reimplemented in TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 105 of file AbstractMeshReader.cpp.

References EXCEPTION.

◆ GetEdgeData()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ElementData AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetEdgeData ( unsigned  index)

Synonym of GetFaceData(index)

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

Definition at line 99 of file AbstractMeshReader.cpp.

◆ GetElementData()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ElementData AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetElementData ( unsigned  index)
virtual

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

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

Reimplemented in GmshMeshReader< ELEMENT_DIM, SPACE_DIM >, and TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 87 of file AbstractMeshReader.cpp.

References EXCEPTION.

Referenced by DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ParMetisLibraryNodeAndElementPartitioning(), and NodePartitioner< ELEMENT_DIM, SPACE_DIM >::PetscMatrixPartitioning().

◆ GetElementIteratorBegin() [1/2]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin ( )
Returns
an iterator to the first element in the file.

Note that, in the case of an ASCII mesh file, for efficiency this will actually start wherever the file pointer currently is. The user is responsible for resetting the reader prior to calling GetElementIteratorBegin().

Definition at line 183 of file AbstractMeshReader.cpp.

Referenced by QuadraticMeshHelper< DIM >::AddInternalNodesToElements().

◆ GetElementIteratorBegin() [2/2]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin ( const std::set< unsigned > &  rIndices)
Returns
an iterator over a set of elements whose indices are given
Parameters
rIndicessubset of indices

Note that, in the case of an ASCII mesh file, for efficiency this will actually start wherever the file pointer currently is. The user is responsible for resetting the reader prior to calling GetElementIteratorBegin().

Definition at line 190 of file AbstractMeshReader.cpp.

◆ GetElementIteratorEnd()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd ( )
Returns
an iterator to (one past the) end of the element data.

Definition at line 197 of file AbstractMeshReader.cpp.

Referenced by QuadraticMeshHelper< DIM >::AddInternalNodesToElements().

◆ GetFaceData()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ElementData AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetFaceData ( unsigned  index)
virtual

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

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

Reimplemented in GmshMeshReader< ELEMENT_DIM, SPACE_DIM >, and TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 93 of file AbstractMeshReader.cpp.

◆ GetMeshFileBaseName()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::string AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetMeshFileBaseName ( )
virtual
Returns
the base name (less any extension) for mesh files. Only implemented for some mesh types.

Reimplemented in TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 111 of file AbstractMeshReader.cpp.

Referenced by TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructFromMeshReader().

◆ GetNextCableElementData()

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

Reimplemented in GmshMeshReader< ELEMENT_DIM, SPACE_DIM >, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >, and VtkMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 173 of file AbstractMeshReader.cpp.

Referenced by MixedDimensionMesh< ELEMENT_DIM, ELEMENT_DIM >::~MixedDimensionMesh().

◆ GetNextEdgeData()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ElementData AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextEdgeData ( )
Returns
a vector of the node indices of each edge (and any attribute/containment information, if there is any) in turn (synonym of GetNextFaceData())

Definition at line 75 of file AbstractMeshReader.cpp.

◆ GetNextElementData()

◆ GetNextFaceData()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
virtual ElementData AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextFaceData ( )
pure virtual

◆ GetNextNode()

◆ GetNode()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< double > AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNode ( unsigned  index)
virtual

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

Parameters
indexThe global node index
Returns
a vector of the coordinates of the node

Reimplemented in GmshMeshReader< ELEMENT_DIM, SPACE_DIM >, and TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 81 of file AbstractMeshReader.cpp.

References EXCEPTION.

◆ GetNodeAttributes()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< double > AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNodeAttributes ( )
virtual
Returns
the vector of node attributes
an empty vector here. Over-ride in child classes if needed. Ideally, this method would be in AbstractCachedMeshReader (where it would return the cached attribuites) but TrianglesMeshReader (the class this method was created for) does not inherit from AbstractCachedMeshReader, so it needs to be here.

Reimplemented in GmshMeshReader< ELEMENT_DIM, SPACE_DIM >, and TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 66 of file AbstractMeshReader.cpp.

Referenced by DistributedTetrahedralMesh< DIM, DIM >::CalculateBoundingBox(), and TetrahedralMesh< DIM, DIM >::SolveNodeMapping().

◆ GetNodeIteratorBegin() [1/2]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNodeIteratorBegin ( )
Returns
an iterator to the first node in the file.

Note that, in the case of an ASCII mesh file, for efficiency this will actually start wherever the file pointer currently is. The user is responsible for resetting the reader prior to calling GetNodeIteratorBegin().

Definition at line 279 of file AbstractMeshReader.cpp.

◆ GetNodeIteratorBegin() [2/2]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNodeIteratorBegin ( const std::set< unsigned > &  rIndices)
Returns
an iterator over a set of nodes whose indices are given
Parameters
rIndicessubset of indices

Note that, in the case of an ASCII mesh file, for efficiency this will actually start wherever the file pointer currently is. The user is responsible for resetting the reader prior to calling GetNodeIteratorBegin().

Definition at line 286 of file AbstractMeshReader.cpp.

◆ GetNodeIteratorEnd()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNodeIteratorEnd ( )
Returns
an iterator to (one past the) end of the node data.

Definition at line 293 of file AbstractMeshReader.cpp.

References AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumNodes().

◆ GetNumCableElementAttributes()

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

Reimplemented in GmshMeshReader< ELEMENT_DIM, SPACE_DIM >, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >, and VtkMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 167 of file AbstractMeshReader.cpp.

◆ GetNumCableElements()

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

Reimplemented in GmshMeshReader< ELEMENT_DIM, SPACE_DIM >, TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >, and VtkMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 161 of file AbstractMeshReader.cpp.

◆ GetNumEdges()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumEdges ( ) const
Returns
the number of edges in the mesh (synonym of GetNumFaces())

Definition at line 52 of file AbstractMeshReader.cpp.

◆ GetNumElementAttributes()

◆ GetNumElements()

◆ GetNumFaceAttributes()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumFaceAttributes ( ) const
virtual

◆ GetNumFaces()

◆ GetNumNodes()

◆ GetOrderOfBoundaryElements()

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

Reimplemented in GmshMeshReader< ELEMENT_DIM, SPACE_DIM >, and TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 123 of file AbstractMeshReader.cpp.

Referenced by QuadraticMeshHelper< DIM >::AddInternalNodesToBoundaryElements().

◆ GetOrderOfElements()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetOrderOfElements ( )
virtual
Returns
the expected order of the element file (1=linear, 2=quadratic)

Reimplemented in GmshMeshReader< ELEMENT_DIM, SPACE_DIM >, and TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 117 of file AbstractMeshReader.cpp.

Referenced by QuadraticMesh< DIM >::ConstructFromMeshReader().

◆ GetReadContainingElementOfBoundaryElement()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetReadContainingElementOfBoundaryElement ( )
virtual
Returns
true if the boundary element file is linear, but contains information about neighbouring elements

Reimplemented in TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 129 of file AbstractMeshReader.cpp.

Referenced by QuadraticMeshHelper< DIM >::AddNodesToBoundaryElements().

◆ HasNclFile()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::HasNclFile ( )
virtual
Returns
true if there is a node connectivity list (NCL) file available.

Note, this will always return false unless over-ridden by a derived class that is able to support NCL files.

Reimplemented in TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 141 of file AbstractMeshReader.cpp.

◆ HasNodePermutation()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::HasNodePermutation ( )
virtual
Returns
true if there is a node permutation applied.

Note, this will always return false unless over-ridden by a derived class that is able to support NCL files.

Reimplemented in TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 147 of file AbstractMeshReader.cpp.

Referenced by Toroidal2dVertexMesh::ConstructFromMeshReader(), PottsMesh< DIM >::ConstructFromMeshReader(), TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructFromMeshReader(), and DistributedTetrahedralMesh< DIM, DIM >::ParMetisLibraryNodeAndElementPartitioning().

◆ IsFileFormatBinary()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::IsFileFormatBinary ( )
virtual
Returns
true if reading binary files, false if reading ascii files.

Note, this will always return false unless over-ridden by a derived class that is able to support binary file formats.

Reimplemented in TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 135 of file AbstractMeshReader.cpp.

Referenced by DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ParMetisLibraryNodeAndElementPartitioning(), and NodePartitioner< ELEMENT_DIM, SPACE_DIM >::PetscMatrixPartitioning().

◆ Reset()

◆ rGetNodePermutation()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
const std::vector< unsigned > & AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::rGetNodePermutation ( )
virtual
Returns
the node permutation if a node permutation has been applied to this reader (or an empty permutation)

Note, this will always throw an exception unless over-ridden by a derived class that is able to support NCL files.

Reimplemented in TrianglesMeshReader< ELEMENT_DIM, SPACE_DIM >.

Definition at line 153 of file AbstractMeshReader.cpp.

References EXCEPTION.


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