36 #ifndef DISTRIBUTEDTETRAHEDRALMESH_HPP_
37 #define DISTRIBUTEDTETRAHEDRALMESH_HPP_
44 #include <boost/serialization/base_object.hpp>
46 #include "AbstractTetrahedralMesh.hpp"
48 #include "AbstractMeshReader.hpp"
49 #include "DistributedTetrahedralMeshPartitionType.hpp"
51 #define UNASSIGNED_NODE UINT_MAX
61 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
64 friend class TestDistributedTetrahedralMesh;
65 friend class TestDistributedQuadraticMesh;
99 friend class boost::serialization::access;
106 template<
class Archive>
107 void serialize(Archive & archive,
const unsigned int version)
109 archive & boost::serialization::base_object<AbstractTetrahedralMesh<ELEMENT_DIM, SPACE_DIM> >(*this);
282 virtual void Scale(
const double xFactor=1.0,
const double yFactor=1.0,
const double zFactor=1.0);
331 void Rotate(c_matrix<double , SPACE_DIM, SPACE_DIM> rotationMatrix);
340 void Translate(
const c_vector<double, SPACE_DIM>& rDisplacement);
410 std::set<unsigned>& rNodesOwned,
411 std::set<unsigned>& rHaloNodesOwned,
412 std::set<unsigned>& rElementsOwned,
413 std::vector<unsigned>& rProcessorsOffset);
427 std::set<unsigned>& rElementsOwned,
428 std::set<unsigned>& rNodesOwned,
429 std::set<unsigned>& rHaloNodesOwned,
430 std::vector<unsigned>& rProcessorsOffset);
467 namespace serialization
472 template<
class Archive,
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
473 inline void save_construct_data(
479 ar << partition_type;
486 template<
class Archive,
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
487 inline void load_construct_data(
494 ar >> partition_type;
508 EXCEPTION(
"This archive was written for a different number of processors");
void ConstructLinearMesh(unsigned width)
unsigned GetNumLocalNodes() const
unsigned GetNumBoundaryElements() const
void RegisterNode(unsigned index)
DistributedTetrahedralMeshPartitionType::type GetPartitionType() const
void Rotate(c_matrix< double, SPACE_DIM, SPACE_DIM > rotationMatrix)
void SetProcessRegion(ChasteCuboid< SPACE_DIM > *pRegion)
#define EXCEPTION(message)
DistributedTetrahedralMeshPartitionType::type mMetisPartitioning
std::vector< Node< SPACE_DIM > * >::const_iterator HaloNodeIterator
virtual void ConstructFromMeshReader(AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader)
DistributedTetrahedralMesh(DistributedTetrahedralMeshPartitionType::type partitioningMethod=DistributedTetrahedralMeshPartitionType::PARMETIS_LIBRARY)
unsigned GetNumNodes() const
void GetHaloNodeIndices(std::vector< unsigned > &rHaloIndices) const
void SetDistributedVectorFactory(DistributedVectorFactory *pFactory)
unsigned mTotalNumBoundaryElements
bool CalculateDesignatedOwnershipOfBoundaryElement(unsigned faceIndex)
void ComputeMeshPartitioning(AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader, std::set< unsigned > &rNodesOwned, std::set< unsigned > &rHaloNodesOwned, std::set< unsigned > &rElementsOwned, std::vector< unsigned > &rProcessorsOffset)
void RegisterElement(unsigned index)
HaloNodeIterator GetHaloNodeIteratorBegin() const
HaloNodeIterator GetHaloNodeIteratorEnd() const
std::map< unsigned, unsigned > mElementsMapping
void RegisterHaloNode(unsigned index)
unsigned GetNumElements() const
unsigned SolveBoundaryElementMapping(unsigned index) const
unsigned SolveNodeMapping(unsigned index) const
unsigned GetNumLocalElements() const
void Translate(const c_vector< double, SPACE_DIM > &rDisplacement)
unsigned mTotalNumElements
unsigned SolveElementMapping(unsigned index) const
#define EXPORT_TEMPLATE_CLASS_ALL_DIMS(CLASS)
virtual c_vector< double, 2 > CalculateMinMaxEdgeLengths()
Node< SPACE_DIM > * GetNodeOrHaloNode(unsigned index) const
virtual ChasteCuboid< SPACE_DIM > CalculateBoundingBox() const
ChasteCuboid< SPACE_DIM > * mpSpaceRegion
std::vector< Node< SPACE_DIM > * > mHaloNodes
virtual void Scale(const double xFactor=1.0, const double yFactor=1.0, const double zFactor=1.0)
std::map< unsigned, unsigned > mHaloNodesMapping
void ConstructCuboid(unsigned width, unsigned height, unsigned depth)
void RegisterBoundaryElement(unsigned index)
unsigned GetNumAllNodes() const
void serialize(Archive &archive, const unsigned int version)
ChasteCuboid< SPACE_DIM > * GetProcessRegion()
virtual unsigned GetNearestNodeIndex(const ChastePoint< SPACE_DIM > &rTestPoint)
unsigned GetNumLocalBoundaryElements() const
unsigned GetNumHaloNodes() const
void ParMetisLibraryNodeAndElementPartitioning(AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader, std::set< unsigned > &rElementsOwned, std::set< unsigned > &rNodesOwned, std::set< unsigned > &rHaloNodesOwned, std::vector< unsigned > &rProcessorsOffset)
bool CalculateDesignatedOwnershipOfElement(unsigned elementIndex)
std::map< unsigned, unsigned > mBoundaryElementsMapping
void ConstructRectangularMesh(unsigned width, unsigned height, bool stagger=true)
void SetElementOwnerships()
virtual ~DistributedTetrahedralMesh()
std::map< unsigned, unsigned > mNodesMapping