Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <XdmfMeshWriter.hpp>

+ Inheritance diagram for XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >:
+ Collaboration diagram for XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >:

Public Member Functions

 XdmfMeshWriter (const std::string &rDirectory, const std::string &rBaseName, const bool clearOutputDir=true)
 
void WriteFiles ()
 
void WriteFilesUsingMesh (AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, bool keepOriginalElementIndexing=true)
 
- Public Member Functions inherited from AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >
 AbstractTetrahedralMeshWriter (const std::string &rDirectory, const std::string &rBaseName, const bool clearOutputDir=true)
 
virtual ~AbstractTetrahedralMeshWriter ()
 
void WriteFilesUsingMeshReaderAndMesh (AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh)
 
std::vector< doubleGetNextNode ()
 
ElementData GetNextElement ()
 
ElementData GetNextBoundaryElement ()
 
ElementData GetNextCableElement ()
 
- Public Member Functions inherited from AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >
 AbstractMeshWriter (const std::string &rDirectory, const std::string &rBaseName, const bool clearOutputDir=true)
 
virtual ~AbstractMeshWriter ()
 
std::string GetOutputDirectory ()
 
virtual unsigned GetNumNodes ()
 
unsigned GetNumElements ()
 
unsigned GetNumBoundaryFaces ()
 
unsigned GetNumCableElements ()
 
void WriteFilesUsingMeshReader (AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader)
 

Protected Attributes

unsigned mNumberOfTimePoints
 
double mTimeStep
 
- Protected Attributes inherited from AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >
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
 
- Protected Attributes inherited from AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >
OutputFileHandlermpOutputFileHandler
 
std::string mBaseName
 
AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > * mpMeshReader
 
unsigned mNumNodes
 
unsigned mNumElements
 
unsigned mNumBoundaryElements
 
unsigned mNumCableElements
 

Private Member Functions

void WriteXdmfMasterFile (unsigned numberOfChunks=1u)
 
virtual void AddDataOnNodes (XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *pGridElement, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *pDomDocument, unsigned timeStep)
 

Detailed Description

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

A class for writing from a Chaste mesh to the geometry/topology components of an XDMF file.

Definition at line 62 of file XdmfMeshWriter.hpp.

Constructor & Destructor Documentation

◆ XdmfMeshWriter()

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

Constructor.

Parameters
rDirectorythe directory in which to write the mesh to file
rBaseNamethe base name of the files in which to write the mesh data
clearOutputDirwhether to clean the directory (defaults to true)

Definition at line 44 of file XdmfMeshWriter.cpp.

Member Function Documentation

◆ AddDataOnNodes()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
virtual void XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::AddDataOnNodes ( XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *  pGridElement,
XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *  pDomDocument,
unsigned  timeStep 
)
inlineprivatevirtual

Generate Attribute tags and append to the element. Here this is a dummy class, but can be overloaded with real variables elsewhere (see pde/src/postprocesssing/Hdf5toXdmfConverter).

Parameters
pGridElementPointer to DOMElement to append Attribute tags to.
pDomDocumentPointer to DOMDocument to generate new elements.
timeStepIndex of time point to write.

Reimplemented in Hdf5ToXdmfConverter< ELEMENT_DIM, SPACE_DIM >.

Definition at line 83 of file XdmfMeshWriter.hpp.

◆ WriteFiles()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles ( )
virtual

Write the files using a mesh reader. Called from WriteFilesUsingMeshReader in the base class.

Implements AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >.

Definition at line 183 of file XdmfMeshWriter.cpp.

References PetscTools::AmMaster(), EXCEPTION, and ChasteBuildInfo::GetProvenanceString().

◆ WriteFilesUsingMesh()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh ( AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &  rMesh,
bool  keepOriginalElementIndexing = true 
)
virtual

◆ WriteXdmfMasterFile()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteXdmfMasterFile ( unsigned  numberOfChunks = 1u)
private

Write the master file. This just contains references to the geometry/topology files.

Parameters
numberOfChunksis the number of geometric pieces which is 1 for sequential code and for non-distributed meshes.

Definition at line 247 of file XdmfMeshWriter.cpp.

References PetscTools::AmMaster(), and ChasteBuildInfo::GetProvenanceString().

Member Data Documentation

◆ mNumberOfTimePoints

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::mNumberOfTimePoints
protected

Defaults to 1, when we are writing geometry only. Used in HDF5 converter which has "protected" access as a derived class.

Definition at line 65 of file XdmfMeshWriter.hpp.

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

◆ mTimeStep

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::mTimeStep
protected

Defaults to 1.0.

Definition at line 66 of file XdmfMeshWriter.hpp.

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


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