CEPS
24.01
Cardiac ElectroPhysiology Simulator
|
Geometry partitioning with PtScotch.
Namespace that regroups the necessary methods to compute a geometry (collection of meshes) partitioning using the PTscotch library. The inputs and outputs for these methods are explained in more detail in the PTScotch documentation.
Definition at line 46 of file PtscotchPartitioner.hpp.
#include <PtscotchPartitioner.hpp>
Public Member Functions | |
PtscotchPartitioner ()=delete | |
no default constructor More... | |
PtscotchPartitioner (Geometry *geom) | |
Constructor with geometry, simply calls base class constructor. More... | |
~PtscotchPartitioner () override=default | |
Destructor. More... | |
CepsUInt | computePartition () override |
Calls the partitioning method specified in the Geometry. More... | |
Public Member Functions inherited from GeometryPartitioner | |
GeometryPartitioner ()=delete | |
Deleted constructor. More... | |
GeometryPartitioner (Geometry *geometry) | |
Constructor based on Geometry instance. More... | |
~GeometryPartitioner () override | |
Destructor. More... | |
Public Member Functions inherited from CepsObject | |
CepsObject ()=default | |
default constructor More... | |
CepsObject (const CepsObject &)=default | |
Copy constructor. More... | |
virtual | ~CepsObject ()=default |
Destructor. More... | |
CepsObject & | operator= (const CepsObject &)=default |
Assignment operator. More... | |
CepsObject * | toBaseObject () |
Returns a pointer to CepsObject class. More... | |
const CepsObject * | toBaseObject () const |
Returns a pointer to CepsObject class, const version. More... | |
Profiler * | getProfiler () const |
Access to profiler. More... | |
Private Member Functions | |
CepsVector< CepsInt > | nodePartitioning () |
Compute a Partitioning using Scotch on the primal graph GeomNode,. More... | |
void | buildDualGraph (CepsVector< CepsInt > &verttab, CepsVector< CepsInt > &edgetab) |
Convert a graph from elements (nodeIndicesOffset,nodeIndices) to a GeomNode graph in Scotch format. More... | |
void | removeFalseDuplicates (CepsVector< CepsInt > &nodeOwnership) |
Internal routine that removes the nodes prev. added for multiple unknowns per node. More... | |
void | buildCellPartitionMap (CepsVector< CepsInt > &nodeOwnership) |
Gives new labels to cell such that they are grouped on each cpu. More... | |
void | restrictCoupledNodesToLocal () |
Keep only coupled nodes local to the cpu. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from GeometryPartitioner | |
void | readMeshOnMaster () |
Read the Mesh on master process before distribution. More... | |
void | broadcastMeshData () |
Copies geometrical information from master on all other processes. More... | |
void | setUpHalo (const CepsVector< CepsInt > &nodeOwnership, const CepsVector< CepsInt > *cellOwnership=nullptr) |
Register nodes in halo regions, and set up communication matrices of data in halos. More... | |
void | buildNodeAdjacency () |
For each node, stores its adjacent nodes and cells. (indices before partitioning) More... | |
void | buildCellAdjacency () |
For each cell, stores its adjacent cells. (indices before partitioning) More... | |
void | nodeAttribution (const CepsVector< CepsInt > &nodeOwnership) |
Creates the lists of nodes in linked geometry according to partition. More... | |
void | cellAttribution () |
Creates the lists of cells and bdry cells in geometry according to partition. More... | |
template<CepsUInt _Dim> | |
void | addCellToMesh (CepsUInt index, CepsBool isOnBoundary, Mesh *mesh) |
Create local simplex structures from geometrical data to fill meshes with. More... | |
CepsUInt | getDimensionByNodeId (CepsUInt i) const |
Get the correct dimension, deduced by node id. More... | |
CepsUInt | getDimensionByCellId (CepsUInt i) const |
Get the correct dimension, deduced by cell id. More... | |
Protected Attributes inherited from GeometryPartitioner | |
Geometry * | m_geom |
Linked geometry to partition. More... | |
CepsSet< CepsCellGlobalIndex > | m_ownedCells |
Indices of local cells and boundary cells. More... | |
CepsSet< CepsNodeGlobalIndex > | m_ownedNodes |
Indices of local nodes. More... | |
CepsSet< CepsNodeGlobalIndex > | m_haloNodes |
Indices of local halo nodes. More... | |
CepsArray4< CepsUInt > | m_nodeOffset |
GeomNode offset. More... | |
CepsArray4< CepsUInt > | m_cellOffset |
Cell offset. More... | |
CepsUInt | m_nbNodes |
Number of nodes in all combined meshes. More... | |
CepsVector< CepsReal > | m_coords |
GeomNode positions. More... | |
CepsVector< CepsAttribute > | m_nodeAttr |
Attributes for each node. More... | |
CepsVector< CepsUInt > | m_nodeAttrOffset |
Offset in m_nodeAttr array for each node. More... | |
CepsUInt | m_nodeAttrSize |
Size of combined lists of attributes per node. More... | |
CepsMap< CepsNodeGlobalIndex, CepsSet< CepsNodeGlobalIndex > > | m_nodeNodeAdj |
lists of adjacent nodes More... | |
CepsMap< CepsNodeGlobalIndex, CepsSet< CepsCellGlobalIndex > > | m_nodeCellAdj |
lists of adjacent cells More... | |
CepsMap< CepsCellGlobalIndex, CepsSet< CepsCellGlobalIndex > > | m_cellCellAdj |
lists of adjacent cells More... | |
CepsSet< CepsCellGlobalIndex > | m_markedCells |
algorithmic flags More... | |
CepsMap< CepsCellGlobalIndex, CepsMathVertex > | m_cellBarycenters |
For cells with 1 node on bdry. More... | |
CepsMultiMap< CepsNodeGlobalIndex, CepsNodeGlobalIndex > | m_coupledNodes |
Links between meshes expressed with coupled nodes. More... | |
CepsUInt | m_nbCells |
Number of cells and boundary cells in all combined meshes. More... | |
CepsVector< CepsInt > | m_nodeIndices |
Node indices for each cell (signed ints for lib compatibility) More... | |
CepsVector< CepsUInt > | m_nodeIndicesOffset |
Offset in m_nodeIndices array for each cell. More... | |
CepsUInt | m_nodeIndicesSize |
Size of combined lists of nodes per cell. More... | |
CepsVector< CepsAttribute > | m_cellAttr |
Cells attributes for each cell. More... | |
CepsVector< CepsUInt > | m_cellAttrOffset |
Offset in m_cellAttr array for each cell. More... | |
CepsUInt | m_cellAttrSize |
Size of combined lists of attributes per cell. More... | |
CepsVector< CepsChar > | m_isBoundary |
Indicates which cell is on the boundary. More... | |
Static Protected Attributes inherited from CepsObject | |
static Profiler | m_profiler |
The same profiler for each big object. More... | |
|
delete |
no default constructor
|
explicit |
Constructor with geometry, simply calls base class constructor.
Definition at line 37 of file PtscotchPartitioner.cpp.
|
overridedefault |
Destructor.
|
private |
Gives new labels to cell such that they are grouped on each cpu.
Definition at line 281 of file PtscotchPartitioner.cpp.
|
private |
Convert a graph from elements (nodeIndicesOffset,nodeIndices) to a GeomNode graph in Scotch format.
verttab | adjacency list |
edgetab | offsets in verttab for each node |
For example : consider the following graph
0---3 |\ |\ | \ | 4 | \|/ 1---2 eptr = [0, 3, 6, 9] | | | | | ------------- | ------- | | | | | | | eind = [0, 1, 2, 0, 2, 3, 3, 2, 4]
Element 0 has nodes 0,1,2, element 1 has nodes 0,2,3, element 2 has nodes 3,2,4.
convertGraphElemToNode will build the following two vectors
edgetab = [0, 3, 5, 9, 12, 14] | | | | | | | | | | | | | | ------------------------ | | | ------------------- | | | ---------- | | | ------- | | | | | | | | verttab = [1, 2, 3, 0, 2, 0, 1, 3, 4, 0, 2, 4, 2, 3]
GeomNode 0 is connected to 1,2,3, node 1 is connected to 0,2, etc.
Definition at line 193 of file PtscotchPartitioner.cpp.
|
overridevirtual |
Calls the partitioning method specified in the Geometry.
The different partitioning methods are defined in the enum type PartitioningMethod::method. The partitioning method is set via the method Geometry::setPartitioningMethod
Implements GeometryPartitioner.
Definition at line 42 of file PtscotchPartitioner.cpp.
|
private |
Compute a Partitioning using Scotch on the primal graph GeomNode,.
Definition at line 94 of file PtscotchPartitioner.cpp.
|
private |
Internal routine that removes the nodes prev. added for multiple unknowns per node.
Definition at line 251 of file PtscotchPartitioner.cpp.
|
private |
Keep only coupled nodes local to the cpu.
Definition at line 393 of file PtscotchPartitioner.cpp.