Chaste
Release::2018.1
|
#include <CmguiMeshWriter.hpp>
Public Member Functions | |
CmguiMeshWriter (const std::string &rDirectory, const std::string &rBaseName, bool cleanDirectory=true) | |
void | WriteFiles () |
void | SetAdditionalFieldNames (std::vector< std::string > &rFieldNames) |
void | SetRegionNames (std::vector< std::string > &rRegionNames) |
virtual | ~CmguiMeshWriter () |
Public Member Functions inherited from AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM > | |
AbstractTetrahedralMeshWriter (const std::string &rDirectory, const std::string &rBaseName, const bool clearOutputDir=true) | |
virtual | ~AbstractTetrahedralMeshWriter () |
virtual void | WriteFilesUsingMesh (AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, bool keepOriginalElementIndexing=true) |
void | WriteFilesUsingMeshReaderAndMesh (AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh) |
std::vector< double > | GetNextNode () |
ElementData | GetNextElement () |
ElementData | GetNextBoundaryElement () |
ElementData | GetNextCableElement () |
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 () |
void | WriteFilesUsingMeshReader (AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader) |
Protected Member Functions | |
std::ios_base::openmode | GetOpenMode (bool append) |
out_stream | OpenNodeFile (bool append=false) |
std::vector< boost::shared_ptr < std::ofstream > > | OpenElementFiles (bool append=false) |
void | WriteNodeFileHeader (out_stream &rpNodeFile) |
void | WriteElementsFileHeader (std::vector< boost::shared_ptr< std::ofstream > > &rElemFiles) |
void | CreateFilesWithHeaders () |
void | AppendLocalDataToFiles () |
void | WriteFilesFooter () |
Writes a mesh in Cmgui (the visualisation frontend of CMISS) format. Creates an exnode file and a exelem file. Note that the lines and faces are not written in the exelem file, so to load the data in Cmgui, you must use 'generate_faces_and_lines', i.e.
gfx read node base_file gfx read elem base_file generate_faces_and_lines gfx cr win
Definition at line 515 of file CmguiMeshWriter.hpp.
CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::CmguiMeshWriter | ( | const std::string & | rDirectory, |
const std::string & | rBaseName, | ||
bool | cleanDirectory = true |
||
) |
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 |
cleanDirectory | whether to clean the directory (defaults to true) |
Definition at line 48 of file CmguiMeshWriter.cpp.
References CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mAdditionalFieldHeader, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mBaseName, CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mCoordinatesFileHeader, CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mElementFileHeader, CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mGroupName, AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mIndexFromZero, CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mNumNodesPerElement, CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mReordering, and NEVER_REACHED.
|
inlinevirtual |
Destructor.
Definition at line 658 of file CmguiMeshWriter.hpp.
|
protectedvirtual |
Append local mesh data to output files.
Reimplemented from AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Definition at line 301 of file CmguiMeshWriter.cpp.
|
protectedvirtual |
Create output files and add headers.
Reimplemented from AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Definition at line 279 of file CmguiMeshWriter.cpp.
|
protected |
append | whether to append to the file, or overwrite it |
Definition at line 361 of file CmguiMeshWriter.cpp.
|
protected |
Helper method that open all the elements files (one per region in this case)
append | whether to clear (append=false) or to append (append=true). False by default. It applies to all files. |
Definition at line 170 of file CmguiMeshWriter.cpp.
References EXCEPTION.
|
protected |
Open the file node information is written to.
append | whether to clear (append=false) or to append (append=true). False by default. |
Definition at line 163 of file CmguiMeshWriter.cpp.
void CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::SetAdditionalFieldNames | ( | std::vector< std::string > & | rFieldNames | ) |
Set any additional field that we want cmgui to visualize (interpolated over) elements and surfaces
rFieldNames | is a reference to a vector of string containing the names of each additional field name |
Definition at line 151 of file CmguiMeshWriter.cpp.
Referenced by Hdf5ToCmguiConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToCmguiConverter().
void CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::SetRegionNames | ( | std::vector< std::string > & | rRegionNames | ) |
Set the region names to be used when generating multiple element files
rRegionNames | is a reference to a vector of string containing the names of each region defined in the mesh |
Definition at line 157 of file CmguiMeshWriter.cpp.
Referenced by Hdf5ToCmguiConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToCmguiConverter().
|
protected |
Write the headers of each element file (as many as number of regions defined).
rElemFiles | vector of pointers to file streams |
Definition at line 239 of file CmguiMeshWriter.cpp.
References ChasteBuildInfo::GetProvenanceString().
|
virtual |
Write mesh data to files.
Implements AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Definition at line 95 of file CmguiMeshWriter.cpp.
References ElementData::AttributeValue, and ElementData::NodeIndices.
|
protectedvirtual |
Append footers to output files.
Reimplemented from AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Definition at line 355 of file CmguiMeshWriter.cpp.
|
protected |
Write the header part of a node file, depending on the dimension. Short helper method, also called in CmguiDeformedSolutionsWriter. (Note, without the & below this method seg faults).
rpNodeFile | reference to the out_stream used for the node file |
Definition at line 206 of file CmguiMeshWriter.cpp.
References ChasteBuildInfo::GetProvenanceString(), and NEVER_REACHED.
|
protected |
String which is set to either CmguiAdditionalFieldHeader2D or CmguiAdditionalFieldHeader2DQuadratic as appropriate
Definition at line 556 of file CmguiMeshWriter.hpp.
Referenced by CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::CmguiMeshWriter().
|
protected |
For storage of names of additional fields.
Definition at line 522 of file CmguiMeshWriter.hpp.
|
protected |
String which is set to either CmguiCoordinatesFileHeader2D or CmguiCoordinatesFileHeader2DQuadratic as appropriate
Definition at line 550 of file CmguiMeshWriter.hpp.
Referenced by CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::CmguiMeshWriter().
|
protected |
String which is set to either CmguiElementFileHeader2D or CmguiElementFileHeader2DQuadratic as appropriate
Definition at line 543 of file CmguiMeshWriter.hpp.
Referenced by CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::CmguiMeshWriter().
|
protected |
The group name to give in the output files. Defaults to the same as the base name. The CmguiDeformedSolutionsWriter prepends a counter to the base name (eg "solution_8.exnodes" instead of just "solution.exnodes"), but we would like the group name to stay as "solution", hence this separate variable
Definition at line 537 of file CmguiMeshWriter.hpp.
Referenced by CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::CmguiMeshWriter().
|
protected |
Number of nodes per element, eg, in 2D, 3 for linear visualisation and 6 for quadratic visualisation
Definition at line 562 of file CmguiMeshWriter.hpp.
Referenced by CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::CmguiMeshWriter().
|
protected |
Stored the names of different regions that we want Cmgui to be able to visualize separately. There will be one .exelem file per region.
Definition at line 529 of file CmguiMeshWriter.hpp.
|
protected |
Ordering of the elements nodes, from Chaste convention to CMGUI convention
Definition at line 567 of file CmguiMeshWriter.hpp.
Referenced by CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::CmguiMeshWriter().