Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
|
#include <AbstractTetrahedralMeshWriter.hpp>
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< 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 () |
virtual void | WriteFiles ()=0 |
void | WriteFilesUsingMeshReader (AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader) |
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 |
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 | 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 | |
NodeMap * | mpNodeMap |
An abstract tetrahedral mesh writer class.
Definition at line 88 of file AbstractTetrahedralMeshWriter.hpp.
AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::AbstractTetrahedralMeshWriter | ( | 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 71 of file AbstractTetrahedralMeshWriter.cpp.
References AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::mpIters.
|
virtual |
Destructor just deletes the node map if memory has been allocated for it
Definition at line 94 of file AbstractTetrahedralMeshWriter.cpp.
|
privatevirtual |
Append local mesh data to output files.
Reimplemented in CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >, CmguiMeshWriter< DIM, DIM >, and MeshalyzerMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Definition at line 657 of file AbstractTetrahedralMeshWriter.cpp.
References NEVER_REACHED.
|
privatevirtual |
Create output files and add headers.
Reimplemented in CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >, CmguiMeshWriter< DIM, DIM >, and MeshalyzerMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Definition at line 646 of file AbstractTetrahedralMeshWriter.cpp.
References NEVER_REACHED.
|
virtual |
Reimplemented from AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Definition at line 228 of file AbstractTetrahedralMeshWriter.cpp.
References PetscTools::AmMaster(), ElementData::AttributeValue, AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextBoundaryElement(), and ElementData::NodeIndices.
|
virtual |
Reimplemented from AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Definition at line 287 of file AbstractTetrahedralMeshWriter.cpp.
References PetscTools::AmMaster(), ElementData::AttributeValue, AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetAttribute(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextCableElement(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::IsDeleted(), and ElementData::NodeIndices.
|
virtual |
Reimplemented from AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Definition at line 168 of file AbstractTetrahedralMeshWriter.cpp.
References PetscTools::AmMaster(), ElementData::AttributeValue, AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetAttribute(), AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextElement(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::IsDeleted(), and ElementData::NodeIndices.
|
virtual |
Reimplemented from AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Definition at line 118 of file AbstractTetrahedralMeshWriter.cpp.
References PetscTools::AmMaster(), and AbstractMeshWriter< ELEMENT_DIM, SPACE_DIM >::GetNextNode().
|
inlineprivate |
Post an element from a slave process to the master for concentration
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().
|
inlineprivate |
Unpack an element from a slave process on the master for concentration
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.
|
privatevirtual |
Append footers to output files.
Reimplemented in CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >, CmguiMeshWriter< DIM, DIM >, and MeshalyzerMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Definition at line 668 of file AbstractTetrahedralMeshWriter.cpp.
References NEVER_REACHED.
|
virtual |
Write a const mesh to file. Used by the serialization methods and avoids iterators...
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. |
Reimplemented in VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >, and XdmfMeshWriter< ELEMENT_DIM, SPACE_DIM >.
Definition at line 441 of file AbstractTetrahedralMeshWriter.cpp.
References PetscTools::AmMaster(), PetscTools::Barrier(), and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes().
Referenced by Hdf5ToCmguiConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToCmguiConverter(), Hdf5ToMeshalyzerConverter< ELEMENT_DIM, SPACE_DIM >::Hdf5ToMeshalyzerConverter(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructCuboid(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructLinearMesh(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructRectangularMesh(), CardiacElectroMechanicsProblem< DIM, ELEC_PROB_DIM >::Initialise(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::save(), and VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMesh().
void AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteFilesUsingMeshReaderAndMesh | ( | AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > & | rMeshReader, |
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > & | rMesh | ||
) |
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.
rMeshReader | a reader of the original mesh files on disk |
rMesh | the mesh object in memory |
Definition at line 523 of file AbstractTetrahedralMeshWriter.cpp.
Referenced by AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::save().
|
privatevirtual |
Write a parallel mesh to file. Used by the serialization methods.
keepOriginalElementIndexing | Whether to write the mesh with the same element ordering as in memory. Optimisations can be applied if this is not needed. |
Definition at line 532 of file AbstractTetrahedralMeshWriter.cpp.
References PetscTools::AmMaster(), PetscTools::AmTopMost(), PetscTools::Barrier(), GenericEventHandler< 11, MeshEventHandler >::BeginEvent(), PetscTools::BeginRoundRobin(), GenericEventHandler< 11, MeshEventHandler >::EndEvent(), PetscTools::EndRoundRobin(), PetscTools::GetMyRank(), and PetscTools::GetNumProcs().
|
private |
Write out a node connectivity information file (collectively called, involves some communication).
rMesh | the mesh object in memory |
invertMeshPermutation | whether to permute the file using the inverse of the mesh's permutation |
Definition at line 331 of file AbstractTetrahedralMeshWriter.cpp.
References PetscTools::AmMaster(), PetscTools::AmTopMost(), PetscTools::Barrier(), GenericEventHandler< 11, MeshEventHandler >::BeginEvent(), PetscTools::BeginRoundRobin(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::CalculateMaximumContainingElementsPerProcess(), GenericEventHandler< 11, MeshEventHandler >::EndEvent(), PetscTools::EndRoundRobin(), FileFinder::GetAbsolutePath(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNodeIteratorBegin(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNodeIteratorEnd(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumAllNodes(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), ChasteBuildInfo::GetProvenanceString(), PetscTools::IsSequential(), and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::rGetNodePermutation().
|
protected |
Used by master process for polling processes for the next boundary element
Definition at line 198 of file AbstractTetrahedralMeshWriter.hpp.
|
protected |
Used by master process for polling processes for the next cable element
Definition at line 199 of file AbstractTetrahedralMeshWriter.hpp.
|
protected |
Used by master process for polling processes for the next element
Definition at line 197 of file AbstractTetrahedralMeshWriter.hpp.
|
protected |
Whether all data is to be written as binary - used in derived class TrianglesMeshWriter
Definition at line 200 of file AbstractTetrahedralMeshWriter.hpp.
|
protected |
True if input data is numbered from zero, false otherwise
Definition at line 194 of file AbstractTetrahedralMeshWriter.hpp.
Referenced by CmguiMeshWriter< ELEMENT_DIM, SPACE_DIM >::CmguiMeshWriter(), MeshalyzerMeshWriter< ELEMENT_DIM, SPACE_DIM >::MeshalyzerMeshWriter(), and VtkMeshWriter< ELEMENT_DIM, SPACE_DIM >::VtkMeshWriter().
|
protected |
Used by master process for polling processes for the next node
Definition at line 196 of file AbstractTetrahedralMeshWriter.hpp.
|
protected |
Same as (ELEMENT_DIM), except when writing a quadratic mesh!
Definition at line 187 of file AbstractTetrahedralMeshWriter.hpp.
|
protected |
Same as (ELEMENT_DIM+1), except when writing a quadratic mesh!
Definition at line 186 of file AbstractTetrahedralMeshWriter.hpp.
|
protected |
Another pointer to the mesh, produced by dynamic cast
Definition at line 190 of file AbstractTetrahedralMeshWriter.hpp.
|
protected |
Handy iterators so that we know the next node/element to be written
Definition at line 192 of file AbstractTetrahedralMeshWriter.hpp.
Referenced by AbstractTetrahedralMeshWriter< ELEMENT_DIM, SPACE_DIM >::AbstractTetrahedralMeshWriter().
|
protected |
Pointer to the mesh (if we are writing from a mesh)
Definition at line 189 of file AbstractTetrahedralMeshWriter.hpp.
|
protected |
Another pointer to the mesh, produced by dynamic cast
Definition at line 191 of file AbstractTetrahedralMeshWriter.hpp.
|
private |
Node map to be used when writing a mesh that has deleted nodes
Definition at line 182 of file AbstractTetrahedralMeshWriter.hpp.
|
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().