Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
VertexMeshWriter< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <VertexMeshWriter.hpp>

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

Public Member Functions

 VertexMeshWriter (const std::string &rDirectory, const std::string &rBaseName, const bool clearOutputDir=true)
 
 ~VertexMeshWriter ()
 
void WriteFilesUsingMesh (VertexMesh< ELEMENT_DIM, SPACE_DIM > &rMesh)
 
void WriteVtkUsingMesh (VertexMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, std::string stamp="")
 
void MakeVtkMesh (VertexMesh< ELEMENT_DIM, SPACE_DIM > &rMesh)
 
void AddCellData (std::string dataName, std::vector< double > dataPayload)
 
void AddPointData (std::string dataName, std::vector< double > dataPayload)
 
std::vector< doubleGetNextNode ()
 
ElementData GetNextElement ()
 
VertexElementData GetNextElementWithFaces ()
 
void WriteFiles ()
 
void WriteVtkUsingMesh (VertexMesh< 2, 2 > &rMesh, std::string stamp)
 
- Public Member Functions inherited from AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >
 AbstractMeshWriter (const std::string &rDirectory, const std::string &rBaseName, const bool clearOutputDir=true)
 
virtual ~AbstractMeshWriter ()
 
std::string GetOutputDirectory ()
 
virtual unsigned GetNumNodes ()
 
unsigned GetNumElements ()
 
unsigned GetNumBoundaryFaces ()
 
unsigned GetNumCableElements ()
 
virtual ElementData GetNextBoundaryElement ()
 
virtual ElementData GetNextCableElement ()
 
void WriteFilesUsingMeshReader (AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader)
 

Private Attributes

VertexMesh< ELEMENT_DIM, SPACE_DIM > * mpMesh
 
MeshWriterIterators< ELEMENT_DIM, SPACE_DIM > * mpIters
 
NodeMapmpNodeMap
 
unsigned mNodeMapCurrentIndex
 
vtkUnstructuredGrid * mpVtkUnstructedMesh
 

Additional Inherited Members

- Protected Attributes inherited from AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >
OutputFileHandlermpOutputFileHandler
 
std::string mBaseName
 
AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > * mpMeshReader
 
unsigned mNumNodes
 
unsigned mNumElements
 
unsigned mNumBoundaryElements
 
unsigned mNumCableElements
 

Detailed Description

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

A mesh writer class for vertex-based meshes.

Definition at line 71 of file VertexMeshWriter.hpp.

Constructor & Destructor Documentation

◆ VertexMeshWriter()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::VertexMeshWriter ( const std::string &  rDirectory,
const std::string &  rBaseName,
const bool  clearOutputDir = true 
)

Constructor.

Parameters
rDirectoryreference to the output directory, relative to where Chaste output is stored
rBaseNamereference to the base name for results files
clearOutputDirwhether to clear the output directory prior to writing files

Definition at line 58 of file VertexMeshWriter.cpp.

References VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpIters, and VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpVtkUnstructedMesh.

◆ ~VertexMeshWriter()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::~VertexMeshWriter ( )

Destructor.

Definition at line 77 of file VertexMeshWriter.cpp.

Member Function Documentation

◆ AddCellData()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::AddCellData ( std::string  dataName,
std::vector< double dataPayload 
)

Add data to a future VTK file.

Parameters
dataNamea tag to go into the VTK file
dataPayloada pay-load of length (number of elements)

Definition at line 337 of file VertexMeshWriter.cpp.

Referenced by VertexBasedCellPopulation< DIM >::WriteCellEdgeVtkResultsToFile(), VertexBasedCellPopulation< DIM >::WriteCellVtkResultsToFile(), and MeshBasedCellPopulationWithGhostNodes< DIM >::WriteVtkResultsToFile().

◆ AddPointData()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::AddPointData ( std::string  dataName,
std::vector< double dataPayload 
)

Add data to a future VTK file.

Parameters
dataNamea tag to go into the VTK file
dataPayloada pay-load of length (number of nodes)

Definition at line 354 of file VertexMeshWriter.cpp.

◆ GetNextElement()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ElementData VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextElement ( )
virtual
Returns
the data (indices/attributes) of the next element to be written to file
Todo:
Assert this method should only be called in 2D? (#1076/#1377)

Reimplemented from AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >.

Definition at line 179 of file VertexMeshWriter.cpp.

References ElementData::AttributeValue, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextElement(), and ElementData::NodeIndices.

◆ GetNextElementWithFaces()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexElementData VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextElementWithFaces ( )
Returns
the data (indices/attributes) of the next element to be written to file, including its faces. This method should only be called in 3D.
Todo:
Store face orientations? (#1076/#1377)

Definition at line 126 of file VertexMeshWriter.cpp.

References ElementData::AttributeValue, VertexElementData::AttributeValue, VertexElementData::Faces, VertexElement< ELEMENT_DIM, SPACE_DIM >::GetFace(), ElementData::NodeIndices, and VertexElementData::NodeIndices.

◆ GetNextNode()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< double > VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextNode ( )
virtual
Returns
the coordinates of the next node to be written to file

Reimplemented from AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >.

Definition at line 99 of file VertexMeshWriter.cpp.

References AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextNode().

◆ MakeVtkMesh()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::MakeVtkMesh ( VertexMesh< ELEMENT_DIM, SPACE_DIM > &  rMesh)

◆ WriteFiles()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles ( )
virtual

Write mesh data to files. This method must be overridden in concrete classes.

Todo:
Store face orientations? (#1076/#1377)

Implements AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >.

Definition at line 400 of file VertexMeshWriter.cpp.

References ElementData::AttributeValue, VertexElementData::AttributeValue, VertexElementData::Faces, ChasteBuildInfo::GetProvenanceString(), ElementData::NodeIndices, and VertexElementData::NodeIndices.

◆ WriteFilesUsingMesh()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh ( VertexMesh< ELEMENT_DIM, SPACE_DIM > &  rMesh)
Todo:
Mesh should be const (#1076)

Write files using a mesh.

Parameters
rMeshreference to the vertex-based mesh
Todo:
Mesh should be const (#1076)

Definition at line 372 of file VertexMeshWriter.cpp.

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

Referenced by VertexMesh< ELEMENT_DIM, SPACE_DIM >::save(), and PottsBasedCellPopulation< DIM >::WriteVtkResultsToFile().

◆ WriteVtkUsingMesh() [1/2]

void VertexMeshWriter< 2, 2 >::WriteVtkUsingMesh ( VertexMesh< 2, 2 > &  rMesh,
std::string  stamp 
)

Write VTK file using a mesh.

Parameters
rMeshreference to the vertex-based mesh
stampis an optional stamp (like a time-stamp) to put into the name of the file

Definition at line 250 of file VertexMeshWriter.cpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetMeshForVtk().

◆ WriteVtkUsingMesh() [2/2]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteVtkUsingMesh ( VertexMesh< ELEMENT_DIM, SPACE_DIM > &  rMesh,
std::string  stamp = "" 
)

Write VTK file using a mesh.

Parameters
rMeshreference to the vertex-based mesh
stampis an optional stamp (like a time-stamp) to put into the name of the file

Definition at line 208 of file VertexMeshWriter.cpp.

Referenced by VertexBasedCellPopulation< DIM >::WriteCellEdgeVtkResultsToFile(), VertexBasedCellPopulation< DIM >::WriteCellVtkResultsToFile(), MeshBasedCellPopulationWithGhostNodes< DIM >::WriteVtkResultsToFile(), and PottsBasedCellPopulation< DIM >::WriteVtkResultsToFile().

Member Data Documentation

◆ mNodeMapCurrentIndex

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::mNodeMapCurrentIndex
private

What was the last index written to mpNodeMap ?

Definition at line 86 of file VertexMeshWriter.hpp.

◆ mpIters

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MeshWriterIterators<ELEMENT_DIM,SPACE_DIM>* VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpIters
private

Iterators over the mesh

Definition at line 81 of file VertexMeshWriter.hpp.

Referenced by VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::VertexMeshWriter().

◆ mpMesh

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexMesh<ELEMENT_DIM,SPACE_DIM>* VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpMesh
private

If writing from a mesh object, the mesh to write to disk. Otherwise NULL.

Definition at line 78 of file VertexMeshWriter.hpp.

◆ mpNodeMap

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
NodeMap* VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpNodeMap
private

Track deleted nodes so they don't get written

Definition at line 84 of file VertexMeshWriter.hpp.

◆ mpVtkUnstructedMesh

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
vtkUnstructuredGrid* VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpVtkUnstructedMesh
private

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