CmguiDeformedSolutionsWriter< DIM > Class Template Reference

#include <CmguiDeformedSolutionsWriter.hpp>

Inheritance diagram for CmguiDeformedSolutionsWriter< DIM >:

Inheritance graph
[legend]
Collaboration diagram for CmguiDeformedSolutionsWriter< DIM >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 CmguiDeformedSolutionsWriter (std::string outputDirectory, std::string baseName, QuadraticMesh< DIM > &rQuadraticMesh, CmguiMeshWriteType writeType)
void WriteInitialMesh ()
void WriteDeformationPositions (std::vector< c_vector< double, DIM > > &rDeformedPositions, unsigned counter)
void WriteCmguiScript (std::string fieldBaseName="")
void ConvertOutput (std::string inputDirectory, std::string inputFileBaseName, unsigned finalCounter)

Private Member Functions

unsigned GetNumNodes ()

Private Attributes

QuadraticMesh< DIM > * mpQuadraticMesh
unsigned mFinalCounter
unsigned mNumNodesToUse


Detailed Description

template<unsigned DIM>
class CmguiDeformedSolutionsWriter< DIM >

CmguiDeformedSolutionsWriter

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 56 of file CmguiDeformedSolutionsWriter.hpp.


Constructor & Destructor Documentation

template<unsigned DIM>
CmguiDeformedSolutionsWriter< DIM >::CmguiDeformedSolutionsWriter ( std::string  outputDirectory,
std::string  baseName,
QuadraticMesh< DIM > &  rQuadraticMesh,
CmguiMeshWriteType  writeType 
) [inline]

Constructor

Parameters:
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
writeType Should be equal to either WRITE_LINEAR_MESH or WRITE_QUADRATIC_MESH, depending on whether linear visualisation of the quadratic mesh (just vertices output) or full quadratic visualisation is required.

Definition at line 33 of file CmguiDeformedSolutionsWriter.cpp.

References CmguiMeshWriter< DIM, DIM >::mAdditionalFieldHeader, CmguiMeshWriter< DIM, DIM >::mCoordinatesFileHeader, CmguiMeshWriter< DIM, DIM >::mElementFileHeader, CmguiMeshWriter< DIM, DIM >::mNumNodesPerElement, CmguiDeformedSolutionsWriter< DIM >::mNumNodesToUse, CmguiDeformedSolutionsWriter< DIM >::mpQuadraticMesh, CmguiMeshWriter< DIM, DIM >::mReordering, and NEVER_REACHED.


Member Function Documentation

template<unsigned DIM>
unsigned CmguiDeformedSolutionsWriter< DIM >::GetNumNodes (  )  [inline, private, virtual]

Overloaded GetNumNodes(), returns either mpQuadraticMesh->GetNumVertices() for linear visualisation or mpQuadraticMesh->GetNumNodes() for quadratic visualisation

Reimplemented from AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >.

Definition at line 81 of file CmguiDeformedSolutionsWriter.hpp.

References CmguiDeformedSolutionsWriter< DIM >::mNumNodesToUse.

Referenced by CmguiDeformedSolutionsWriter< DIM >::WriteDeformationPositions().

template<unsigned DIM>
void CmguiDeformedSolutionsWriter< DIM >::WriteInitialMesh (  )  [inline]

template<unsigned DIM>
void CmguiDeformedSolutionsWriter< DIM >::WriteDeformationPositions ( std::vector< c_vector< double, DIM > > &  rDeformedPositions,
unsigned  counter 
) [inline]

template<unsigned DIM>
void CmguiDeformedSolutionsWriter< DIM >::WriteCmguiScript ( std::string  fieldBaseName = ""  )  [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()

Parameters:
fieldBaseName If there is a field to visualise on top of the deforming mesh, give it's path (relative to the cmgui deformation directory), and filename prefix. Leave empty if no field to visualise. For example, WriteCmguiScript("../../electrics/cmgui_output/voltage_mechanics_mesh"); for the script to read files voltage_mechanics_mesh_0.exnode .. voltage_mechanics_mesh_N.exnode.

Definition at line 153 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(), AbstractNonlinearElasticitySolver< DIM >::CreateCmguiOutput(), and CardiacElectroMechanicsProblem< DIM >::Solve().

template<unsigned DIM>
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.

Parameters:
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 173 of file CmguiDeformedSolutionsWriter.cpp.

References EXCEPTION, CmguiDeformedSolutionsWriter< DIM >::mpQuadraticMesh, CmguiDeformedSolutionsWriter< DIM >::WriteCmguiScript(), CmguiDeformedSolutionsWriter< DIM >::WriteDeformationPositions(), and CmguiDeformedSolutionsWriter< DIM >::WriteInitialMesh().


Member Data Documentation

template<unsigned DIM>
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 63 of file CmguiDeformedSolutionsWriter.hpp.

Referenced by CmguiDeformedSolutionsWriter< DIM >::CmguiDeformedSolutionsWriter(), CmguiDeformedSolutionsWriter< DIM >::ConvertOutput(), CmguiDeformedSolutionsWriter< DIM >::WriteDeformationPositions(), and CmguiDeformedSolutionsWriter< DIM >::WriteInitialMesh().

template<unsigned DIM>
unsigned CmguiDeformedSolutionsWriter< DIM >::mFinalCounter [private]

A counter is given whenever WriteDeformationPositions() is called, this variable stores the last one used

Definition at line 69 of file CmguiDeformedSolutionsWriter.hpp.

Referenced by CmguiDeformedSolutionsWriter< DIM >::WriteCmguiScript(), and CmguiDeformedSolutionsWriter< DIM >::WriteDeformationPositions().

template<unsigned DIM>
unsigned CmguiDeformedSolutionsWriter< DIM >::mNumNodesToUse [private]

Number of nodes to output - either mpQuadraticMesh->GetNumVertices() (linear visualisation) mpQuadraticMesh->GetNumNodes() (quadratic visualisation)

Definition at line 75 of file CmguiDeformedSolutionsWriter.hpp.

Referenced by CmguiDeformedSolutionsWriter< DIM >::CmguiDeformedSolutionsWriter(), and CmguiDeformedSolutionsWriter< DIM >::GetNumNodes().


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

Generated on Tue May 31 14:33:03 2011 for Chaste by  doxygen 1.5.5