Chaste
Release::2017.1
|
#include <XdmfMeshWriter.hpp>
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< double > | GetNextNode () |
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 > | |
OutputFileHandler * | mpOutputFileHandler |
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) |
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 |
||
) |
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.
Referenced by XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::AddDataOnNodes().
|
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).
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.
References XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFiles(), XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh(), and XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::XdmfMeshWriter().
Referenced by XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteXdmfMasterFile().
|
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().
Referenced by XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::AddDataOnNodes().
|
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 XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >::AddDataOnNodes(), and Hdf5ToXdmfConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToXdmfConverter().
|
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().
|
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().
|
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().