CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <CmguiMeshWriter.hpp>

Inheritance diagram for CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >:

Inheritance graph
[legend]
Collaboration diagram for CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >:

Collaboration graph
[legend]

List of all members.

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 ()

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::vector< std::string > mRegionNames
std::string mGroupName
std::string mElementFileHeader
std::string mCoordinatesFileHeader
std::string mAdditionalFieldHeader
unsigned mNumNodesPerElement
std::vector< unsigned > mReordering


Detailed Description

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
class CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >

CmguiMeshWriter

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 510 of file CmguiMeshWriter.hpp.


Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::CmguiMeshWriter ( const std::string &  rDirectory,
const std::string &  rBaseName,
bool  cleanDirectory = true 
) [inline]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
virtual CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::~CmguiMeshWriter (  )  [inline, virtual]

Destructor.

Definition at line 607 of file CmguiMeshWriter.hpp.


Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
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).

Parameters:
rpNodeFile reference to the out_stream used for the node file

Definition at line 202 of file CmguiMeshWriter.cpp.

References ChasteBuildInfo::GetProvenanceString(), CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mGroupName, and NEVER_REACHED.

Referenced by CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles (  )  [inline, virtual]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
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

Parameters:
rFieldNames is a reference to a vector of string containing the names of each additional field name

Definition at line 189 of file CmguiMeshWriter.cpp.

References CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mAdditionalFieldNames.

Referenced by Hdf5ToCmguiConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToCmguiConverter().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::SetRegionNames ( std::vector< std::string > &  rRegionNames  )  [inline]

Set the region names to be used when generating multiple element files

Parameters:
rRegionNames is a reference to a vector of string containing the names of each region defined in the mesh

Definition at line 195 of file CmguiMeshWriter.cpp.

References CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mRegionNames.

Referenced by Hdf5ToCmguiConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToCmguiConverter().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
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.

Parameters:
rPath1 path to the first file from calling directory (or full absolute)
rPath2 path to the second file from calling directory (or full absolute)
Returns:
true if the file are the same (except for the provenance lines), false otherwise

Definition at line 235 of file CmguiMeshWriter.cpp.


Member Data Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<std::string> CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mAdditionalFieldNames [protected]

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<std::string> CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mRegionNames [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 524 of file CmguiMeshWriter.hpp.

Referenced by CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::SetRegionNames(), and CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
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 532 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().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::string CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mElementFileHeader [protected]

String which is set to either CmguiElementFileHeader2D or CmguiElementFileHeader2DQuadratic as appropriate

Definition at line 538 of file CmguiMeshWriter.hpp.

Referenced by CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::CmguiMeshWriter(), and CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::string CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mCoordinatesFileHeader [protected]

String which is set to either CmguiCoordinatesFileHeader2D or CmguiCoordinatesFileHeader2DQuadratic as appropriate

Definition at line 545 of file CmguiMeshWriter.hpp.

Referenced by CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::CmguiMeshWriter(), and CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::string CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mAdditionalFieldHeader [protected]

String which is set to either CmguiAdditionalFieldHeader2D or CmguiAdditionalFieldHeader2DQuadratic as appropriate

Definition at line 551 of file CmguiMeshWriter.hpp.

Referenced by CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::CmguiMeshWriter(), and CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mNumNodesPerElement [protected]

Number of nodes per element, eg, in 2D, 3 for linear visualisation and 6 for quadratic visualisation

Definition at line 557 of file CmguiMeshWriter.hpp.

Referenced by CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::CmguiMeshWriter(), and CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<unsigned> CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::mReordering [protected]

Ordering of the elements nodes, from Chaste convention to CMGUI convention

Definition at line 562 of file CmguiMeshWriter.hpp.

Referenced by CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::CmguiMeshWriter(), and CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles().


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

Generated on Mon Apr 18 11:36:44 2011 for Chaste by  doxygen 1.5.5