#include <CmguiMeshWriter.hpp>
Inherits AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Public Member Functions | |
CmguiMeshWriter (const std::string &rDirectory, const std::string &rBaseName, bool cleanDirectory=true) | |
void | WriteFiles () |
void | SetAdditionalFieldNames (std::vector< std::string > &rFieldNames) |
virtual | ~CmguiMeshWriter () |
Static Public Member Functions | |
static bool | CompareCmguiFiles (std::string &rPath1, std::string &rPath2) |
Protected Member Functions | |
void | WriteNodeFileHeader (out_stream &rpNodeFile) |
Protected Attributes | |
std::vector< std::string > | mAdditionalFieldNames |
std::string | mGroupName |
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 234 of file CmguiMeshWriter.hpp.
CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::CmguiMeshWriter | ( | const std::string & | rDirectory, | |
const std::string & | rBaseName, | |||
bool | cleanDirectory = 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 | |
cleanDirectory | whether to clean the directory (defaults to true) |
Definition at line 36 of file CmguiMeshWriter.cpp.
References AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mBaseName, CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mGroupName, and AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mIndexFromZero.
virtual CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::~CmguiMeshWriter | ( | ) | [inline, virtual] |
Destructor.
Definition at line 287 of file CmguiMeshWriter.hpp.
bool CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::CompareCmguiFiles | ( | std::string & | rPath1, | |
std::string & | rPath2 | |||
) | [inline, static] |
Compare two cmgui files, helper methods for tests. It will ignore the provenance lines of the files.
rPath1 | path to the first file from calling directory (or full absolute) | |
rPath2 | path to the second file from calling directory (or full absolute) |
Definition at line 229 of file CmguiMeshWriter.cpp.
void CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::SetAdditionalFieldNames | ( | std::vector< std::string > & | rFieldNames | ) | [inline] |
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 190 of file CmguiMeshWriter.cpp.
References CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mAdditionalFieldNames.
Referenced by Hdf5ToCmguiConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToCmguiConverter().
void CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles | ( | ) | [inline, virtual] |
Write mesh data to files.
Implements AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Definition at line 46 of file CmguiMeshWriter.cpp.
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(), ChasteBuildInfo::GetProvenanceString(), CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mAdditionalFieldNames, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mBaseName, CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mGroupName, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpOutputFileHandler, ElementData::NodeIndices, OutputFileHandler::OpenOutputFile(), and CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteNodeFileHeader().
void CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteNodeFileHeader | ( | out_stream & | rpNodeFile | ) | [inline, 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 196 of file CmguiMeshWriter.cpp.
References ChasteBuildInfo::GetProvenanceString(), and CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mGroupName.
Referenced by CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles().
std::vector<std::string> CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mAdditionalFieldNames [protected] |
For storage of names of additional fields.
Definition at line 241 of file CmguiMeshWriter.hpp.
Referenced by CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::SetAdditionalFieldNames(), and CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles().
std::string CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mGroupName [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 249 of file CmguiMeshWriter.hpp.
Referenced by CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::CmguiMeshWriter(), CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles(), and CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteNodeFileHeader().