#include <TrianglesMeshWriter.hpp>
Inherits AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Public Member Functions | |
TrianglesMeshWriter (const std::string &rDirectory, const std::string &rBaseName, const bool clearOutputDir=true) | |
void | SetWriteFilesAsBinary () |
void | WriteFiles () |
void | WriteElementsAsFaces () |
void | WriteFacesAsEdges () |
template<class T > | |
void | WriteItem (out_stream &pFile, unsigned itemNumber, const std::vector< T > &dataPacket, unsigned attribute=UINT_MAX) |
virtual | ~TrianglesMeshWriter () |
Private Attributes | |
bool | mFilesAreBinary |
A concrete mesh writer class that writes Triangle output files.
Definition at line 41 of file TrianglesMeshWriter.hpp.
TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::TrianglesMeshWriter | ( | const std::string & | rDirectory, | |
const std::string & | rBaseName, | |||
const bool | clearOutputDir = 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 | |
clearOutputDir | whether to clean the directory (defaults to true) |
Definition at line 39 of file TrianglesMeshWriter.cpp.
TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::~TrianglesMeshWriter | ( | ) | [inline, virtual] |
Destructor.
Definition at line 49 of file TrianglesMeshWriter.cpp.
void TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::SetWriteFilesAsBinary | ( | ) | [inline] |
Switch this mesh write to write binary files
(set to write ascii files in the constructor)
Definition at line 54 of file TrianglesMeshWriter.cpp.
References TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::mFilesAreBinary.
Referenced by AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM >::save().
void TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteElementsAsFaces | ( | ) | [inline] |
Write elements as faces (used in the case ELEMENT_DIM== SPACE_DIM-1)
Definition at line 192 of file TrianglesMeshWriter.cpp.
References AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextElement(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNumElements(), ChasteBuildInfo::GetProvenanceString(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mBaseName, TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::mFilesAreBinary, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpOutputFileHandler, OutputFileHandler::OpenOutputFile(), and TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteItem().
Referenced by TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles().
void TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFacesAsEdges | ( | ) | [inline] |
Write faces as edges (used in the case ELEMENT_DIM==2, SPACE_DIM==3)
Definition at line 235 of file TrianglesMeshWriter.cpp.
References AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNumBoundaryFaces(), ChasteBuildInfo::GetProvenanceString(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mBaseName, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mBoundaryFaceData, TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::mFilesAreBinary, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpOutputFileHandler, OutputFileHandler::OpenOutputFile(), and TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteItem().
Referenced by TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles().
void TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles | ( | ) | [inline, virtual] |
Write mesh data to files.
Implements AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Definition at line 60 of file TrianglesMeshWriter.cpp.
References ElementData::AttributeValue, AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextElement(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextNode(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNumBoundaryFaces(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNumElements(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), ChasteBuildInfo::GetProvenanceString(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mBaseName, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mBoundaryFaceData, TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::mFilesAreBinary, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpOutputFileHandler, ElementData::NodeIndices, OutputFileHandler::OpenOutputFile(), TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteElementsAsFaces(), TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFacesAsEdges(), and TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteItem().
void TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteItem | ( | out_stream & | pFile, | |
unsigned | itemNumber, | |||
const std::vector< T > & | dataPacket, | |||
unsigned | attribute = UINT_MAX | |||
) | [inline] |
Write a line (ascii format) to a specific file stream Templated over std::vector dataPacket contents of unsigned or doubles.
pFile | Pointer to file stream | |
itemNumber | Index of the element, node or face | |
dataPacket | List of unsigneds (for node indices) or doubles (for node locations) | |
attribute | An attribute (defaults to UINT_MAX for no attribute when writing elements as faces) |
Definition at line 279 of file TrianglesMeshWriter.cpp.
References TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::mFilesAreBinary.
Referenced by TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteElementsAsFaces(), TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFacesAsEdges(), and TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles().
bool TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::mFilesAreBinary [private] |
Whether all data is to be written as binary
Definition at line 44 of file TrianglesMeshWriter.hpp.
Referenced by TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::SetWriteFilesAsBinary(), TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteElementsAsFaces(), TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFacesAsEdges(), TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles(), and TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteItem().