#include <XdmfMeshWriter.hpp>
Inherits AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Inherited by Hdf5ToXdmfConverter< 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) |
Protected Attributes | |
unsigned | mNumberOfTimePoints |
double | mTimeStep |
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) |
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.
XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::XdmfMeshWriter | ( | const std::string & | rDirectory, | |
const std::string & | rBaseName, | |||
const bool | clearOutputDir = true | |||
) | [inline] |
Constructor.
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 44 of file XdmfMeshWriter.cpp.
virtual void XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::AddDataOnNodes | ( | XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * | pGridElement, | |
XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * | pDomDocument, | |||
unsigned | timeStep | |||
) | [inline, private, virtual] |
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).
pGridElement | Pointer to DOMElement to append Attribute tags to. | |
pDomDocument | Pointer to DOMDocument to generate new elements. | |
timeStep | Index of time point to write. |
Reimplemented in Hdf5ToXdmfConverter< ELEMENT_DIM, SPACE_DIM >.
Definition at line 83 of file XdmfMeshWriter.hpp.
Referenced by XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteXdmfMasterFile().
void XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles | ( | ) | [inline, 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, AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextElement(), AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextNode(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNumElements(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), ChasteBuildInfo::GetProvenanceString(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mBaseName, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpOutputFileHandler, ElementData::NodeIndices, OutputFileHandler::OpenOutputFile(), and XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteXdmfMasterFile().
void XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh | ( | AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > & | rMesh, | |
bool | keepOriginalElementIndexing = true | |||
) | [inline, virtual] |
Write the files using mesh -- this allows the parallel distributed case to write only local data.
rMesh | the mesh | |
keepOriginalElementIndexing | Whether to write the mesh with the same element ordering. Ignored in this derived class |
Reimplemented from AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Definition at line 54 of file XdmfMeshWriter.cpp.
References PetscTools::AmMaster(), PetscTools::Barrier(), EXCEPTION, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd(), PetscTools::GetMyRank(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNodeIteratorBegin(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNodeIteratorEnd(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetNumElements(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), PetscTools::GetNumProcs(), ChasteBuildInfo::GetProvenanceString(), PetscTools::IsParallel(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mBaseName, AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpDistributedMesh, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpOutputFileHandler, OutputFileHandler::OpenOutputFile(), and XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteXdmfMasterFile().
Referenced by Hdf5ToXdmfConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToXdmfConverter().
void XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteXdmfMasterFile | ( | unsigned | numberOfChunks = 1u |
) | [inline, private] |
Write the master file. This just contains references to the geometry/topology files.
numberOfChunks | is 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 XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::AddDataOnNodes(), PetscTools::AmMaster(), OutputFileHandler::GetOutputDirectoryFullPath(), ChasteBuildInfo::GetProvenanceString(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mBaseName, XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::mNumberOfTimePoints, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpOutputFileHandler, and XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::mTimeStep.
Referenced by XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles(), and XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh().
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(), and XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteXdmfMasterFile().
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(), and XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteXdmfMasterFile().