#include <VtkMeshReader.hpp>
Public Member Functions | |
VtkMeshReader (std::string pathBaseName) | |
VtkMeshReader (vtkUnstructuredGrid *p_vtkUnstructuredGrid) | |
virtual | ~VtkMeshReader () |
unsigned | GetNumElements () const |
unsigned | GetNumNodes () const |
unsigned | GetNumFaces () const |
unsigned | GetNumEdges () const |
unsigned | GetNumElementAttributes () const |
unsigned | GetNumFaceAttributes () const |
void | Reset () |
void | Initialize () |
std::vector< double > | GetNextNode () |
ElementData | GetNextElementData () |
ElementData | GetNextFaceData () |
void | GetCellData (std::string dataName, std::vector< double > &dataPayload) |
void | GetPointData (std::string dataName, std::vector< double > &dataPayload) |
void | GetCellData (std::string dataName, std::vector< c_vector< double, SPACE_DIM > > &dataPayload) |
void | GetPointData (std::string dataName, std::vector< c_vector< double, SPACE_DIM > > &dataPayload) |
vtkUnstructuredGrid * | OutputMeshAsVtkUnstructuredGrid () |
Private Attributes | |
vtkUnstructuredGrid * | mpVtkUnstructuredGrid |
vtkGeometryFilter * | mpVtkGeometryFilter |
bool | mIndexFromZero |
std::ifstream | mVtuFile |
unsigned | mNumNodes |
unsigned | mNumElements |
unsigned | mNumFaces |
unsigned | mNodesRead |
unsigned | mElementsRead |
unsigned | mFacesRead |
unsigned | mBoundaryFacesRead |
unsigned | mNumNodeAttributes |
unsigned | mMaxNodeBdyMarker |
unsigned | mNumElementAttributes |
unsigned | mNumFaceAttributes |
unsigned | mOrderOfElements |
unsigned | mNodesPerElement |
Reads a mesh from VTK .vtu format (that's an XML-based, data compressed unstructured mesh)
Definition at line 70 of file VtkMeshReader.hpp.
VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::VtkMeshReader | ( | std::string | pathBaseName | ) | [inline] |
Constructor
pathBaseName | Full file path of the input file |
Definition at line 43 of file VtkMeshReader.cpp.
References EXCEPTION, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElements, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaces, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodes, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mpVtkGeometryFilter, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mpVtkUnstructuredGrid, and VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mVtuFile.
VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::VtkMeshReader | ( | vtkUnstructuredGrid * | p_vtkUnstructuredGrid | ) | [inline] |
Alternative constructor, takes a vtkUnstructuredGrid that is already in memory as an input parameter rather than a .vtu file
p_vtkUnstructuredGrid | Pointer to a vtkUnstructuredGrid object |
Definition at line 87 of file VtkMeshReader.cpp.
References VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElements, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaces, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodes, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mpVtkGeometryFilter, and VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mpVtkUnstructuredGrid.
VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::~VtkMeshReader | ( | ) | [inline, virtual] |
Destructor
Definition at line 115 of file VtkMeshReader.cpp.
References VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mpVtkGeometryFilter.
unsigned VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElements | ( | ) | const [inline, virtual] |
Returns the mNumElements
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 121 of file VtkMeshReader.cpp.
References VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElements.
unsigned VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumNodes | ( | ) | const [inline, virtual] |
Returns mNumNodes
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 127 of file VtkMeshReader.cpp.
References VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodes.
unsigned VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumFaces | ( | ) | const [inline, virtual] |
Returns mNumFaces (synonym of GetNumEdges() method)
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 133 of file VtkMeshReader.cpp.
References VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaces.
unsigned VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumEdges | ( | ) | const [inline] |
Returns mNumFaces (synonym of GetNumFaces() method)
Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 139 of file VtkMeshReader.cpp.
References VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaces.
unsigned VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElementAttributes | ( | ) | const [inline, virtual] |
Returns mNumElementAttributes
Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 145 of file VtkMeshReader.cpp.
References VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElementAttributes.
unsigned VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumFaceAttributes | ( | ) | const [inline, virtual] |
Returns mNumFaceAttributes
Reimplemented from AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 151 of file VtkMeshReader.cpp.
References VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaceAttributes.
void VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset | ( | ) | [inline, virtual] |
Resets mNodesRead, mElementsRead, mFacesRead and mBoundaryFacesRead to zero (for another pass through the mesh from the beginning
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 157 of file VtkMeshReader.cpp.
References VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mBoundaryFacesRead, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementsRead, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mFacesRead, and VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesRead.
void VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::Initialize | ( | ) | [inline] |
Deletes the vtkUnstructuredGrid and vtkGeometryFilter in preparation for deletion of the mesh reader (should) not be called if the vtkUnstructuredGrid is still required elsewhere, e.g. in an AdaptiveTetrahedralMesh or an AdaptiveBidomainProblem.
Definition at line 170 of file VtkMeshReader.cpp.
References VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mpVtkUnstructuredGrid.
std::vector< double > VtkMeshReader< 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 176 of file VtkMeshReader.cpp.
References EXCEPTION, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesRead, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodes, and VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mpVtkUnstructuredGrid.
ElementData VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData | ( | ) | [inline, virtual] |
Returns a vector of the nodes of each element (and any attribute infomation, if there is any) in turn
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 195 of file VtkMeshReader.cpp.
References ElementData::AttributeValue, EXCEPTION, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementsRead, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesPerElement, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElements, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mpVtkUnstructuredGrid, and ElementData::NodeIndices.
ElementData VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextFaceData | ( | ) | [inline, virtual] |
Returns a vector of the nodes of each face in turn (synonym of GetNextEdgeData())
Implements AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >.
Definition at line 222 of file VtkMeshReader.cpp.
References EXCEPTION, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mBoundaryFacesRead, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaces, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mpVtkGeometryFilter, and ElementData::NodeIndices.
void VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetCellData | ( | std::string | dataName, | |
std::vector< double > & | dataPayload | |||
) | [inline] |
Returns an std::vector containing the vtkCellData with attribute name specified Throws if the attribute name does not exist
dataName | Name of the cell data | |
dataPayload | in which to store the result |
Definition at line 242 of file VtkMeshReader.cpp.
References EXCEPTION, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElements, and VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mpVtkUnstructuredGrid.
void VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetPointData | ( | std::string | dataName, | |
std::vector< double > & | dataPayload | |||
) | [inline] |
Returns an std::vector containing the vtkPointData with attribute name specified Throws if the attribute name does not exist
dataName | Name of the point data | |
dataPayload | in which to store the result |
Definition at line 294 of file VtkMeshReader.cpp.
References EXCEPTION, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodes, and VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mpVtkUnstructuredGrid.
void VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetCellData | ( | std::string | dataName, | |
std::vector< c_vector< double, SPACE_DIM > > & | dataPayload | |||
) | [inline] |
Returns an std::vector containing the vector-directed vtkCellData with attribute name specified Throws if the attribute name does not exist
dataName | Name of the cell data | |
dataPayload | in which to store the result |
Definition at line 265 of file VtkMeshReader.cpp.
References EXCEPTION, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElements, and VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mpVtkUnstructuredGrid.
void VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetPointData | ( | std::string | dataName, | |
std::vector< c_vector< double, SPACE_DIM > > & | dataPayload | |||
) | [inline] |
Returns an std::vector containing the vector-directed vtkPointData with attribute name specified Throws if the attribute name does not exist
dataName | Name of the point data | |
dataPayload | in which to store the result |
Definition at line 318 of file VtkMeshReader.cpp.
References EXCEPTION, VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodes, and VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mpVtkUnstructuredGrid.
vtkUnstructuredGrid * VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::OutputMeshAsVtkUnstructuredGrid | ( | ) | [inline] |
Return a pointer to mpVtkUnstructuredGrid
Definition at line 347 of file VtkMeshReader.cpp.
References VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mpVtkUnstructuredGrid.
vtkUnstructuredGrid* VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mpVtkUnstructuredGrid [private] |
vtkUnstructuredGrid object: the rest of the class acts as an interface to this
Definition at line 75 of file VtkMeshReader.hpp.
Referenced by VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetCellData(), VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData(), VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextNode(), VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetPointData(), VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::Initialize(), VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::OutputMeshAsVtkUnstructuredGrid(), and VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::VtkMeshReader().
vtkGeometryFilter* VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mpVtkGeometryFilter [private] |
vtkGeometry filter object to extract the surface elements
Definition at line 78 of file VtkMeshReader.hpp.
Referenced by VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextFaceData(), VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::VtkMeshReader(), and VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::~VtkMeshReader().
bool VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mIndexFromZero [private] |
True if input data is numbered from zero, false otherwise
Definition at line 80 of file VtkMeshReader.hpp.
std::ifstream VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mVtuFile [private] |
Location of the .vtu file
Definition at line 82 of file VtkMeshReader.hpp.
Referenced by VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::VtkMeshReader().
unsigned VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodes [private] |
Number of nodes in the mesh
Definition at line 84 of file VtkMeshReader.hpp.
Referenced by VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextNode(), VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetPointData(), and VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::VtkMeshReader().
unsigned VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElements [private] |
Number of elements in the mesh
Definition at line 85 of file VtkMeshReader.hpp.
Referenced by VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetCellData(), VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData(), VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElements(), and VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::VtkMeshReader().
unsigned VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaces [private] |
Number of faces in the mesh
Definition at line 86 of file VtkMeshReader.hpp.
Referenced by VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextFaceData(), VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumEdges(), VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumFaces(), and VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::VtkMeshReader().
unsigned VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesRead [private] |
Number of nodes read from file so far
Definition at line 88 of file VtkMeshReader.hpp.
Referenced by VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextNode(), and VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset().
unsigned VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mElementsRead [private] |
Number of elements read from file so far
Definition at line 89 of file VtkMeshReader.hpp.
Referenced by VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData(), and VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset().
unsigned VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mFacesRead [private] |
Number of faces read from file so far
Definition at line 90 of file VtkMeshReader.hpp.
Referenced by VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset().
unsigned VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mBoundaryFacesRead [private] |
Number of boundary faces read from file so far
Definition at line 91 of file VtkMeshReader.hpp.
Referenced by VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextFaceData(), and VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset().
unsigned VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumNodeAttributes [private] |
Is the number of attributes stored at each node
Definition at line 93 of file VtkMeshReader.hpp.
unsigned VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mMaxNodeBdyMarker [private] |
Is the maximum node boundary marker
Definition at line 94 of file VtkMeshReader.hpp.
unsigned VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumElementAttributes [private] |
Is the number of attributes stored for each element
Definition at line 95 of file VtkMeshReader.hpp.
Referenced by VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElementAttributes().
unsigned VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNumFaceAttributes [private] |
Is the number of attributes stored for each face
Definition at line 96 of file VtkMeshReader.hpp.
Referenced by VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumFaceAttributes().
unsigned VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mOrderOfElements [private] |
Order of the elements (i.e. linear, quadratic, cubic FE basis functions
Definition at line 98 of file VtkMeshReader.hpp.
unsigned VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::mNodesPerElement [private] |
Number of nodes per element
Definition at line 99 of file VtkMeshReader.hpp.
Referenced by VtkMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData().