37 #ifndef _ABSTRACTTETRAHEDRALMESHWRITER_HPP_
38 #define _ABSTRACTTETRAHEDRALMESHWRITER_HPP_
41 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
44 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
47 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
50 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
55 #include <boost/scoped_array.hpp>
57 #include "AbstractMeshWriter.hpp"
58 #include "AbstractMesh.hpp"
59 #include "NodeMap.hpp"
61 #include "GenericEventHandler.hpp"
87 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
99 void PostElement(
unsigned globalIndex,
unsigned indices[],
unsigned numIndices,
unsigned tag,
double attribute)
102 MPI_Ssend(indices, numIndices, MPI_UNSIGNED, 0,
108 MPI_Ssend(&attribute, 1, MPI_DOUBLE, 0,
122 assert( numIndices == rElementData.
NodeIndices.size());
123 boost::scoped_array<unsigned> raw_indices(
new unsigned[numIndices]);
127 MPI_Recv(raw_indices.get(), numIndices, MPI_UNSIGNED, MPI_ANY_SOURCE,
129 PETSC_COMM_WORLD, &status);
132 for (
unsigned j=0; j< rElementData.
NodeIndices.size(); j++)
140 MPI_Recv(&attribute, 1U, MPI_DOUBLE, MPI_ANY_SOURCE,
142 PETSC_COMM_WORLD, &status);
165 bool invertMeshPermutation=
false);
212 const std::string& rBaseName,
213 const bool clearOutputDir=
true);
230 bool keepOriginalElementIndexing=
true);
266 #endif //_ABSTRACTTETRAHEDRALMESHWRITER_HPP_
ElementData GetNextCableElement()
void UnpackElement(ElementData &rElementData, unsigned globalIndex, unsigned numIndices, unsigned tag)
ElementData GetNextBoundaryElement()
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * mpMesh
AbstractTetrahedralMeshWriter(const std::string &rDirectory, const std::string &rBaseName, const bool clearOutputDir=true)
static void BeginEvent(unsigned event)
virtual void CreateFilesWithHeaders()
unsigned mNodesPerBoundaryElement
MeshWriterIterators< ELEMENT_DIM, SPACE_DIM > * mpIters
std::vector< unsigned > NodeIndices
void WriteNclFile(AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, bool invertMeshPermutation=false)
std::vector< double > GetNextNode()
static const char * EventName[11]
DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * mpDistributedMesh
virtual void WriteFilesUsingParallelMesh(bool keepOriginalElementIndexing=true)
ElementData GetNextElement()
virtual ~AbstractTetrahedralMeshWriter()
void PostElement(unsigned globalIndex, unsigned indices[], unsigned numIndices, unsigned tag, double attribute)
unsigned mElementCounterForParallelMesh
virtual void WriteFilesFooter()
MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM > * mpMixedMesh
unsigned mNodesPerElement
unsigned mNodeCounterForParallelMesh
static void EndEvent(unsigned event)
virtual void WriteFilesUsingMesh(AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, bool keepOriginalElementIndexing=true)
unsigned mBoundaryElementCounterForParallelMesh
unsigned mCableElementCounterForParallelMesh
virtual void AppendLocalDataToFiles()
void WriteFilesUsingMeshReaderAndMesh(AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh)