#include <CmguiDeformedSolutionsWriter.hpp>
Inherits CmguiMeshWriter< DIM, DIM >.
Public Member Functions | |
CmguiDeformedSolutionsWriter (std::string outputDirectory, std::string baseName, QuadraticMesh< DIM > &rQuadraticMesh) | |
void | WriteInitialMesh () |
void | WriteDeformationPositions (std::vector< c_vector< double, DIM > > &rDeformedPositions, unsigned counter) |
void | WriteCmguiScript () |
void | ConvertOutput (std::string inputDirectory, std::string inputFileBaseName, unsigned finalCounter) |
Private Member Functions | |
unsigned | GetNumNodes () |
Private Attributes | |
QuadraticMesh< DIM > * | mpQuadraticMesh |
unsigned | mFinalCounter |
A class for writing a mesh, and solutions from a solid mechanics (ie deformed meshes) problem, in Cmgui output format.
Inherits from CmguiMeshWriter
Definition at line 46 of file CmguiDeformedSolutionsWriter.hpp.
CmguiDeformedSolutionsWriter< DIM >::CmguiDeformedSolutionsWriter | ( | std::string | outputDirectory, | |
std::string | baseName, | |||
QuadraticMesh< DIM > & | rQuadraticMesh | |||
) | [inline] |
Constructor
outputDirectory | The output directory for the Cmgui files | |
baseName | The base name for the Cmgui output files - the files written will be [basename_0.exnode, [basename]_0.exelem; [basename]_1.exnode, [basename]_2.exnode, .. | |
rQuadraticMesh | The quadratic mesh used in the mechanics simulation |
Definition at line 33 of file CmguiDeformedSolutionsWriter.cpp.
void CmguiDeformedSolutionsWriter< DIM >::ConvertOutput | ( | std::string | inputDirectory, | |
std::string | inputFileBaseName, | |||
unsigned | finalCounter | |||
) | [inline] |
For a simulation that has already been run, convert the chaste output to cmgui format.
inputDirectory | The directory the chaste output is in | |
inputFileBaseName | The base name for the chaste output | |
finalCounter | The final counter, ie the value N for the final file [basename]_N.nodes. The first file is assumed to be [basename]_0.nodes. The files [basename]_0.nodes up to [basename]_N.nodes will be converted to cmgui format and put in the output directory given in the constructor. |
Definition at line 96 of file CmguiDeformedSolutionsWriter.cpp.
References CmguiDeformedSolutionsWriter< DIM >::mpQuadraticMesh, CmguiDeformedSolutionsWriter< DIM >::WriteCmguiScript(), CmguiDeformedSolutionsWriter< DIM >::WriteDeformationPositions(), and CmguiDeformedSolutionsWriter< DIM >::WriteInitialMesh().
unsigned CmguiDeformedSolutionsWriter< DIM >::GetNumNodes | ( | ) | [inline, private, virtual] |
Overridden GetNumNodes() just returns the number of vertices in the quadratic mesh, since (currently - perhaps not in the future) the cmgui element file assumes linear interpolation in the elements and therefore we don't need to write the internal nodes
Reimplemented from AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Definition at line 66 of file CmguiDeformedSolutionsWriter.hpp.
References CmguiDeformedSolutionsWriter< DIM >::mpQuadraticMesh.
void CmguiDeformedSolutionsWriter< DIM >::WriteCmguiScript | ( | ) | [inline] |
Writes a small cmgui script called LoadSolutions.com, for loading the output that has been written. Assumes the output was solution_0.exnode .. solution_N.exnode, where N is the counter that was given in the last call to WriteDeformationPositions()
Definition at line 83 of file CmguiDeformedSolutionsWriter.cpp.
References AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mBaseName, CmguiDeformedSolutionsWriter< DIM >::mFinalCounter, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpOutputFileHandler, and OutputFileHandler::OpenOutputFile().
Referenced by CmguiDeformedSolutionsWriter< DIM >::ConvertOutput(), and CardiacElectroMechanicsProblem< DIM >::Solve().
void CmguiDeformedSolutionsWriter< DIM >::WriteDeformationPositions | ( | std::vector< c_vector< double, DIM > > & | rDeformedPositions, | |
unsigned | counter | |||
) | [inline] |
Write [basename]_i.exnode using the given deformed positions
rDeformedPositions | std::vector of deformed positions to be used, must have size equal to number of nodes in the mesh | |
counter | the value "i" in "[basename]_i.exnode" to be used. |
Definition at line 52 of file CmguiDeformedSolutionsWriter.cpp.
References AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mBaseName, CmguiDeformedSolutionsWriter< DIM >::mFinalCounter, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpOutputFileHandler, CmguiDeformedSolutionsWriter< DIM >::mpQuadraticMesh, OutputFileHandler::OpenOutputFile(), and CmguiMeshWriter< DIM, DIM >::WriteNodeFileHeader().
Referenced by CmguiDeformedSolutionsWriter< DIM >::ConvertOutput(), and CardiacElectroMechanicsProblem< DIM >::Solve().
void CmguiDeformedSolutionsWriter< DIM >::WriteInitialMesh | ( | ) | [inline] |
Write [basename]_0.exnode, [basename]_0.exelem using the quadratic mesh
Definition at line 43 of file CmguiDeformedSolutionsWriter.cpp.
References AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mBaseName, CmguiDeformedSolutionsWriter< DIM >::mpQuadraticMesh, and AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh().
Referenced by CmguiDeformedSolutionsWriter< DIM >::ConvertOutput(), and CardiacElectroMechanicsProblem< DIM >::Solve().
unsigned CmguiDeformedSolutionsWriter< DIM >::mFinalCounter [private] |
A counter is given whenever WriteDeformationPositions() is called, this variable stores the last one used
Definition at line 59 of file CmguiDeformedSolutionsWriter.hpp.
Referenced by CmguiDeformedSolutionsWriter< DIM >::WriteCmguiScript(), and CmguiDeformedSolutionsWriter< DIM >::WriteDeformationPositions().
QuadraticMesh<DIM>* CmguiDeformedSolutionsWriter< DIM >::mpQuadraticMesh [private] |
The quadratic mesh used in the mechanics simulation. solution_0.exnode and solution_0.exelem (the only exelem file written) will be written using this mesh
Definition at line 53 of file CmguiDeformedSolutionsWriter.hpp.
Referenced by CmguiDeformedSolutionsWriter< DIM >::ConvertOutput(), CmguiDeformedSolutionsWriter< DIM >::GetNumNodes(), CmguiDeformedSolutionsWriter< DIM >::WriteDeformationPositions(), and CmguiDeformedSolutionsWriter< DIM >::WriteInitialMesh().