1#ifndef MeshPartitioner_decl_hpp
2#define MeshPartitioner_decl_hpp
4#include "feddlib/core/FEDDCore.hpp"
5#include "feddlib/core/General/DefaultTypeDefs.hpp"
6#include "feddlib/core/FE/Domain.hpp"
9#define FEDD_HAVE_PARMETIS
14#ifdef FEDD_HAVE_PARMETIS
51template <
class SC = default_sc,
class LO = default_lo,
class GO = default_go,
class NO = default_no>
52class MeshPartitioner {
56 typedef typename Domain_Type::DomainPtr_Type DomainPtr_Type;
57 typedef typename Domain_Type::CommConstPtr_Type CommConstPtr_Type;
58 typedef std::vector<DomainPtr_Type> DomainPtrArray_Type;
59 typedef typename Domain_Type::MeshUnstr_Type MeshUnstr_Type;
60 typedef typename Domain_Type::MeshUnstrPtr_Type MeshUnstrPtr_Type;
61 typedef typename Domain_Type::MapConstPtr_Type MapConstPtr_Type;
63 typedef Teuchos::RCP<Elements_Type> ElementsPtr_Type;
65 typedef Teuchos::RCP<EdgeElements_Type> EdgeElementsPtr_Type;
67 typedef std::vector<idx_t> vec_idx_Type;
71 MeshPartitioner( DomainPtrArray_Type domains, ParameterListPtr_Type pL, std::string feType,
int dimension );
103 void buildEdgeList( MeshUnstrPtr_Type mesh, ElementsPtr_Type& elementsGlobal );
110 void determineRanks();
112 void determineRanksFromNumberRanks(vec_int_Type& ranks);
114 void determineRanksFromFractions(vec_int_Type& fractions);
116 void makeContinuousElements(ElementsPtr_Type elements, vec_idx_Type& eind_vec, vec_idx_Type& eptr_vec );
121 void findAndSetSurfacesPartitioned( vec2D_int_Type& surfElements_vec,vec2D_int_Type& surfElements_vec_unsorted, vec_int_Type& surfElementsFlag_vec,
FiniteElement& element, vec2D_int_Type& permutation, vec_GO_Type& linearSurfacePartitionOffset,
int globalElID);
131 void findAndSetSurfaceEdges( vec2D_int_Type& edgeElements_vec, vec_int_Type& edgeElementsFlag_vec,
FiniteElement& element, vec2D_int_Type& permutation, MapConstPtr_Type mapRepeated);
136 int searchInSurfaces( vec2D_int_Type& surfaces, vec_int_Type searchSurface);
138 void setLocalSurfaceIndices(vec2D_int_Type &localSurfaceIndices,
int surfaceElementOrder );
145 void readAndPartitionMesh(
int meshNumber );
147 ParameterListPtr_Type pList_;
148 DomainPtrArray_Type domains_;
149 CommConstPtr_Type comm_;
151 std::vector< tuple_intint_Type > rankRanges_;
Definition Domain_decl.hpp:20
Definition EdgeElements.hpp:17
Definition Elements.hpp:22
Definition FiniteElement.hpp:17
void readAndPartition(int volumeID=10)
Main Function of partitioner. Called with volume ID in order to set in case it is not equal to ten....
Definition MeshPartitioner_def.hpp:41
void partitionMesh(MeshUnstrPtr_Type &mesh, int meshNumber)
Main function, that reads and partions and distributes the mesh to the different processors....
void findAndSetSurfacesPartitioned(vec2D_int_Type &surfElements_vec, vec2D_int_Type &surfElements_vec_unsorted, vec_int_Type &surfElementsFlag_vec, FiniteElement &element, vec2D_int_Type &permutation, vec_GO_Type &linearSurfacePartitionOffset, int globalElID)
Finding the surfaces corresponding to a specfic element and then setting subelements.
Definition MeshPartitioner_def.hpp:641
int searchInSurfaces(vec2D_int_Type &surfaces, vec_int_Type searchSurface)
Searching on particular surface in a surface list.
Definition MeshPartitioner_def.hpp:905
void setSurfacesToElements(int meshNumber)
Setting surfaces, i.e. edges in 2D and triangles in 3D, as subelements to the corresponding elements.
Definition MeshPartitioner_def.hpp:559
void buildEdgeListParallel(MeshUnstrPtr_Type mesh, ElementsPtr_Type elementsGlobal)
Making the edge list parallel.
Definition MeshPartitioner_def.hpp:736
void setEdgesToSurfaces(int meshNumber)
Only used in 3D to set the edges as subelements to surfaces.
Definition MeshPartitioner_def.hpp:510
void findAndSetSurfaceEdges(vec2D_int_Type &edgeElements_vec, vec_int_Type &edgeElementsFlag_vec, FiniteElement &element, vec2D_int_Type &permutation, MapConstPtr_Type mapRepeated)
Only relevant in 3D. Finding the edges corresponding to the specfic element and then setting as subsu...
Definition MeshPartitioner_def.hpp:854
void setLocalSurfaceEdgeIndices(vec2D_int_Type &localSurfaceEdgeIndices, int edgesElementOrder)
Setting local IDs to the edges in 3D case with respect to the local numbering of elements.
Definition MeshPartitioner_def.hpp:831
void buildEdgeList(MeshUnstrPtr_Type mesh, ElementsPtr_Type &elementsGlobal)
Building the edge list.
void setLocalEdgeIndices(vec2D_int_Type &localEdgeIndices)
Setting surfaces, i.e. edges in 2D and triangles in 3D, as subelements to the corresponding elements.
Definition MeshPartitioner_def.hpp:784
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement.cpp:5