#include <VtkMeshWriter.hpp>
Public Member Functions | |
VtkMeshWriter (const std::string &rDirectory, const std::string &rBaseName, const bool &rCleanDirectory=true) | |
void | WriteFiles () |
void | AddCellData (std::string name, std::vector< double > data) |
void | AddPointData (std::string name, std::vector< double > data) |
virtual | ~VtkMeshWriter () |
Private Member Functions | |
void | MakeVtkMesh () |
Private Attributes | |
vtkUnstructuredGrid * | mpVtkUnstructedMesh |
Writes a mesh in VTK .vtu format (that's an XML-based, data compressed unstructured mesh)
Definition at line 55 of file VtkMeshWriter.hpp.
VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::VtkMeshWriter | ( | const std::string & | rDirectory, | |
const std::string & | rBaseName, | |||
const bool & | rCleanDirectory = true | |||
) | [inline] |
Constructor.
rDirectory | the directory in which to write the mesh to file | |
rBaseName | the base name of the files in which to write the mesh data | |
rCleanDirectory | whether to clean the directory (defaults to true) |
Definition at line 118 of file VtkMeshWriter.hpp.
References AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mIndexFromZero, and VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpVtkUnstructedMesh.
VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::~VtkMeshWriter | ( | ) | [inline, virtual] |
Destructor.
Definition at line 130 of file VtkMeshWriter.hpp.
References VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpVtkUnstructedMesh.
void VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::MakeVtkMesh | ( | ) | [inline, private] |
Private helper method which copies the mesh details into the waiting VTK mesh structure. Called by WriteFiles().
Definition at line 136 of file VtkMeshWriter.hpp.
References AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextElement(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextNode(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNumElements(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpVtkUnstructedMesh, and ElementData::NodeIndices.
Referenced by VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles().
void VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles | ( | ) | [inline, virtual] |
Write mesh data to files.
Implements AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Definition at line 179 of file VtkMeshWriter.hpp.
References OutputFileHandler::GetOutputDirectoryFullPath(), ChasteBuildInfo::GetProvenanceString(), VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::MakeVtkMesh(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mBaseName, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpOutputFileHandler, VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpVtkUnstructedMesh, and OutputFileHandler::OpenOutputFile().
void VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::AddCellData | ( | std::string | name, | |
std::vector< double > | data | |||
) | [inline] |
Add a scalar data field to each element (known as "cell" in VTK).
name | is a meaningful name with which to annotate the data | |
data | is the data which should appear in the same order as the element numbering The length of the data vector is assumed to match the number of elements in the mesh. Checking cannot be done at this stage since the data is associated with an empty VTK mesh structure. |
Definition at line 210 of file VtkMeshWriter.hpp.
References VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpVtkUnstructedMesh.
void VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::AddPointData | ( | std::string | name, | |
std::vector< double > | data | |||
) | [inline] |
Add a scalar data field to each node (known as "point" in VTK).
name | is a meaningful name with which to annotate the data | |
data | is the data which should appear in the same order as the node numbering The length of the data vector is assumed to match the number of nodes in the mesh Checking cannot be done at this stage since the data is associated with an empty VTK mesh structure. |
Definition at line 225 of file VtkMeshWriter.hpp.
References VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpVtkUnstructedMesh.
Referenced by Hdf5ToVtkConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToVtkConverter().
vtkUnstructuredGrid* VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpVtkUnstructedMesh [private] |
A VTK mesh data structure. Created at construction, has data associated with it by AddCellData and AddCellPoint, then is filled with mesh geometry by MakeVtkMesh() in WriteFiles().
Definition at line 67 of file VtkMeshWriter.hpp.
Referenced by VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::AddCellData(), VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::AddPointData(), VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::MakeVtkMesh(), VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::VtkMeshWriter(), VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles(), and VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::~VtkMeshWriter().