AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <AbstractTetrahedralMeshWriter.hpp>

Inherits AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >.

Inherited by CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >, CmguiMeshWriter< DIM, DIM >, MeshalyzerMeshWriter< ELEMENT_DIM, SPACE_DIM >, TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >, VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >, and XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >.

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

List of all members.

Public Member Functions

 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< doubleGetNextNode ()
ElementData GetNextElement ()
ElementData GetNextBoundaryElement ()
ElementData GetNextCableElement ()

Protected Attributes

unsigned mNodesPerElement
unsigned mNodesPerBoundaryElement
AbstractTetrahedralMesh
< ELEMENT_DIM, SPACE_DIM > * 
mpMesh
DistributedTetrahedralMesh
< ELEMENT_DIM, SPACE_DIM > * 
mpDistributedMesh
MixedDimensionMesh
< ELEMENT_DIM, SPACE_DIM > * 
mpMixedMesh
MeshWriterIterators
< ELEMENT_DIM, SPACE_DIM > * 
mpIters
bool mIndexFromZero
bool mWriteMetaFile
unsigned mNodeCounterForParallelMesh
unsigned mElementCounterForParallelMesh
unsigned mBoundaryElementCounterForParallelMesh
unsigned mCableElementCounterForParallelMesh
bool mFilesAreBinary

Private Member Functions

void PostElement (unsigned globalIndex, unsigned indices[], unsigned numIndices, unsigned tag, double attribute)
void UnpackElement (ElementData &rElementData, unsigned globalIndex, unsigned numIndices, unsigned tag)
virtual void WriteFilesUsingParallelMesh (bool keepOriginalElementIndexing=true)
void WriteNclFile (AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, bool invertMeshPermutation=false)
virtual void CreateFilesWithHeaders ()
virtual void AppendLocalDataToFiles ()
virtual void WriteFilesFooter ()

Private Attributes

NodeMapmpNodeMap

Detailed Description

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

An abstract tetrahedral mesh writer class.

Definition at line 88 of file AbstractTetrahedralMeshWriter.hpp.


Constructor & Destructor Documentation

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

Constructor.

Parameters:
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
clearOutputDir whether to clean the directory (defaults to true)

Definition at line 72 of file AbstractTetrahedralMeshWriter.cpp.

References AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpIters.

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

Destructor just deletes the node map if memory has been allocated for it

Definition at line 95 of file AbstractTetrahedralMeshWriter.cpp.

References AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpIters, and AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpNodeMap.


Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::AppendLocalDataToFiles (  )  [inline, private, virtual]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::CreateFilesWithHeaders (  )  [inline, private, virtual]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ElementData AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextBoundaryElement (  )  [inline, virtual]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ElementData AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextCableElement (  )  [inline, virtual]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
ElementData AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextElement (  )  [inline, virtual]
Returns:
the data (indices/attributes) of the next element to be written to file

Reimplemented from AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >.

Definition at line 170 of file AbstractTetrahedralMeshWriter.cpp.

References PetscTools::AmMaster(), ElementData::AttributeValue, AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetAttribute(), NodeMap::GetNewIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::IsDeleted(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mElementCounterForParallelMesh, AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mNodesPerElement, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mNumElements, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mNumNodes, AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpDistributedMesh, AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpIters, AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpMesh, AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpNodeMap, ElementData::NodeIndices, and AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::UnpackElement().

Referenced by VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::MakeVtkMesh(), TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteElementsAsFaces(), XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles(), TrianglesMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles(), MeshalyzerMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles(), and CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector< double > AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextNode (  )  [inline, virtual]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::PostElement ( unsigned  globalIndex,
unsigned  indices[],
unsigned  numIndices,
unsigned  tag,
double  attribute 
) [inline, private]

Post an element from a slave process to the master for concentration

Parameters:
globalIndex index of this element
indices the node index data for this element
numIndices number of indices
tag temporary
attribute 

Definition at line 99 of file AbstractTetrahedralMeshWriter.hpp.

References GenericEventHandler< 11, MeshEventHandler >::BeginEvent(), and GenericEventHandler< 11, MeshEventHandler >::EndEvent().

Referenced by AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingParallelMesh().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::UnpackElement ( ElementData rElementData,
unsigned  globalIndex,
unsigned  numIndices,
unsigned  tag 
) [inline, private]

Unpack an element from a slave process on the master for concentration

Parameters:
rElementData the output structure to fill (should have the NodeIndices structure of the correct size
globalIndex index of this element
numIndices number of indices
tag temporary

Definition at line 120 of file AbstractTetrahedralMeshWriter.hpp.

References ElementData::AttributeValue, GenericEventHandler< 11, MeshEventHandler >::BeginEvent(), GenericEventHandler< 11, MeshEventHandler >::EndEvent(), and ElementData::NodeIndices.

Referenced by AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextBoundaryElement(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextCableElement(), and AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextElement().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesFooter (  )  [inline, private, virtual]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh ( AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &  rMesh,
bool  keepOriginalElementIndexing = true 
) [inline, virtual]

Write a const mesh to file. Used by the serialization methods and avoids iterators...

Parameters:
rMesh the mesh
keepOriginalElementIndexing Whether to write the mesh with the same element ordering as in memory. Optimisations can be applied if this is not needed.
Todo:
#1322 Mesh should really be const!
Todo:
#1322 Mesh should be const

Todo:
#1322 This should be const too
Todo:
#1322, This should be const too

Reimplemented in VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >, and XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >.

Definition at line 442 of file AbstractTetrahedralMeshWriter.cpp.

References PetscTools::AmMaster(), PetscTools::Barrier(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mFilesAreBinary, AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mNodesPerBoundaryElement, AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mNodesPerElement, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mNumBoundaryElements, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mNumCableElements, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mNumElements, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mNumNodes, AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpDistributedMesh, AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpIters, AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpMesh, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpMeshReader, AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpMixedMesh, AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpNodeMap, NodeMap::SetNewIndex(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingParallelMesh(), and AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteNclFile().

Referenced by DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructCuboid(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructLinearMesh(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructRectangularMesh(), Hdf5ToCmguiConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToCmguiConverter(), Hdf5ToMeshalyzerConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToMeshalyzerConverter(), CardiacElectroMechanicsProblem< DIM, ELEC_PROB_DIM >::Initialise(), CellBasedPdeHandler< DIM >::OpenResultsFiles(), AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM >::save(), and CmguiDeformedSolutionsWriter< DIM >::WriteInitialMesh().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMeshReaderAndMesh ( AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &  rMeshReader,
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &  rMesh 
) [inline]

Write a const mesh to file. Used by the serialization methods and avoids iterators. The master process will use the mesh reader to copy over most of the mesh files, converting them to binary format. However, the mesh is used to write a .ncl file which contains node connectivity information.

Parameters:
rMeshReader a reader of the original mesh files on disk
rMesh the mesh object in memory

Definition at line 524 of file AbstractTetrahedralMeshWriter.cpp.

References AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMeshReader(), and AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteNclFile().

Referenced by AbstractTetrahedralMesh< SPACE_DIM, SPACE_DIM >::save().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingParallelMesh ( bool  keepOriginalElementIndexing = true  )  [inline, private, virtual]

Write a parallel mesh to file. Used by the serialization methods.

Parameters:
keepOriginalElementIndexing Whether to write the mesh with the same element ordering as in memory. Optimisations can be applied if this is not needed.

Todo:
#2351 Also exclude VTK writer

Definition at line 533 of file AbstractTetrahedralMeshWriter.cpp.

References PetscTools::AmMaster(), PetscTools::AmTopMost(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::AppendLocalDataToFiles(), PetscTools::Barrier(), GenericEventHandler< 11, MeshEventHandler >::BeginEvent(), PetscTools::BeginRoundRobin(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::CreateFilesWithHeaders(), GenericEventHandler< 11, MeshEventHandler >::EndEvent(), PetscTools::EndRoundRobin(), PetscTools::GetMyRank(), PetscTools::GetNumProcs(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mNodesPerElement, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mNumBoundaryElements, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mNumElements, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mNumNodes, AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpDistributedMesh, AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpMesh, AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpMixedMesh, AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::PostElement(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles(), and AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesFooter().

Referenced by AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteNclFile ( AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &  rMesh,
bool  invertMeshPermutation = false 
) [inline, private]

Member Data Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mBoundaryElementCounterForParallelMesh [protected]

Used by master process for polling processes for the next boundary element

Definition at line 198 of file AbstractTetrahedralMeshWriter.hpp.

Referenced by AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextBoundaryElement().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mCableElementCounterForParallelMesh [protected]

Used by master process for polling processes for the next cable element

Definition at line 199 of file AbstractTetrahedralMeshWriter.hpp.

Referenced by AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextCableElement().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mElementCounterForParallelMesh [protected]

Used by master process for polling processes for the next element

Definition at line 197 of file AbstractTetrahedralMeshWriter.hpp.

Referenced by AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextElement().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mFilesAreBinary [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mIndexFromZero [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mNodeCounterForParallelMesh [protected]

Used by master process for polling processes for the next node

Definition at line 196 of file AbstractTetrahedralMeshWriter.hpp.

Referenced by AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextNode().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mNodesPerBoundaryElement [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mNodesPerElement [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
DistributedTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpDistributedMesh [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MeshWriterIterators<ELEMENT_DIM,SPACE_DIM>* AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpIters [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpMesh [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
MixedDimensionMesh<ELEMENT_DIM,SPACE_DIM>* AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpMixedMesh [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
NodeMap* AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpNodeMap [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mWriteMetaFile [protected]

Whether to write a metafile (only used by MeshylazerMeshWriter)

Definition at line 195 of file AbstractTetrahedralMeshWriter.hpp.

Referenced by MeshalyzerMeshWriter< ELEMENT_DIM, SPACE_DIM >::MeshalyzerMeshWriter(), and MeshalyzerMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteMetaFile().


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

Generated by  doxygen 1.6.2