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
61template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
64 friend class TestDistributedTetrahedralMesh;
65 friend class TestDistributedQuadraticMesh;
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);
467namespace serialization
472template<
class Archive,
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
473inline void save_construct_data(
479 ar << partition_type;
486template<
class Archive,
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
487inline void load_construct_data(
494 ar >> partition_type;
508 EXCEPTION(
"This archive was written for a different number of processors");
#define EXCEPTION(message)
gcov doesn't like this file...
#define EXPORT_TEMPLATE_CLASS_ALL_DIMS(CLASS)
void serialize(Archive &archive, const unsigned int version)
unsigned mTotalNumElements
unsigned GetNumAllNodes() const
std::map< unsigned, unsigned > mNodesMapping
unsigned GetNumLocalNodes() const
bool CalculateDesignatedOwnershipOfElement(unsigned elementIndex)
virtual void ConstructFromMeshReader(AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader)
unsigned GetNumHaloNodes() const
ChasteCuboid< SPACE_DIM > * GetProcessRegion()
virtual c_vector< double, 2 > CalculateMinMaxEdgeLengths()
std::map< unsigned, unsigned > mElementsMapping
Node< SPACE_DIM > * GetNodeOrHaloNode(unsigned index) const
virtual ~DistributedTetrahedralMesh()
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)
virtual unsigned GetNearestNodeIndex(const ChastePoint< SPACE_DIM > &rTestPoint)
unsigned GetNumNodes() const
HaloNodeIterator GetHaloNodeIteratorEnd() const
unsigned SolveElementMapping(unsigned index) const
void ConstructRectangularMesh(unsigned width, unsigned height, bool stagger=true)
void RegisterNode(unsigned index)
unsigned GetNumBoundaryElements() const
void Translate(const c_vector< double, SPACE_DIM > &rDisplacement)
unsigned mTotalNumBoundaryElements
DistributedTetrahedralMeshPartitionType::type GetPartitionType() const
unsigned SolveBoundaryElementMapping(unsigned index) const
void SetDistributedVectorFactory(DistributedVectorFactory *pFactory)
bool CalculateDesignatedOwnershipOfBoundaryElement(unsigned faceIndex)
HaloNodeIterator GetHaloNodeIteratorBegin() const
std::map< unsigned, unsigned > mHaloNodesMapping
unsigned GetNumLocalElements() const
void RegisterHaloNode(unsigned index)
std::map< unsigned, unsigned > mBoundaryElementsMapping
unsigned SolveNodeMapping(unsigned index) 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)
virtual void Scale(const double xFactor=1.0, const double yFactor=1.0, const double zFactor=1.0)
std::vector< Node< SPACE_DIM > * > mHaloNodes
void ConstructCuboid(unsigned width, unsigned height, unsigned depth)
friend class boost::serialization::access
void Rotate(c_matrix< double, SPACE_DIM, SPACE_DIM > rotationMatrix)
void ConstructLinearMesh(unsigned width)
std::vector< Node< SPACE_DIM > * >::const_iterator HaloNodeIterator
void SetElementOwnerships()
void SetProcessRegion(ChasteCuboid< SPACE_DIM > *pRegion)
void GetHaloNodeIndices(std::vector< unsigned > &rHaloIndices) const
unsigned GetNumElements() const
void RegisterBoundaryElement(unsigned index)
virtual ChasteCuboid< SPACE_DIM > CalculateBoundingBox() const
DistributedTetrahedralMeshPartitionType::type mPartitioning
ChasteCuboid< SPACE_DIM > * mpSpaceRegion
unsigned GetNumLocalBoundaryElements() const
static bool CheckNumberOfProcessesOnLoad()