GEOS
Namespaces | Typedefs | Functions
ParMETISInterface.hpp File Reference
#include "common/DataTypes.hpp"
#include "common/MpiWrapper.hpp"

Go to the source code of this file.

Namespaces

 geos
 

Typedefs

using geos::pmet_idx_t = int64_t
 Typedef to allow us to specify required parmetis integer type.
 

Functions

ArrayOfArrays< pmet_idx_t, pmet_idx_t > geos::parmetis::meshToDual (ArrayOfArraysView< pmet_idx_t const, pmet_idx_t > const &elemToNodes, arrayView1d< pmet_idx_t const > const &elemDist, MPI_Comm comm, int const minCommonNodes)
 Convert a element-node mesh map into a dual (element-element) graph. More...
 
array1d< pmet_idx_t > geos::parmetis::partition (ArrayOfArraysView< pmet_idx_t const, pmet_idx_t > const &graph, arrayView1d< pmet_idx_t const > const &vertDist, pmet_idx_t const numParts, MPI_Comm comm, int const numRefinements)
 Partition a mesh according to its dual graph. More...
 

Function Documentation

◆ meshToDual()

ArrayOfArrays< pmet_idx_t, pmet_idx_t > geos::parmetis::meshToDual ( ArrayOfArraysView< pmet_idx_t const, pmet_idx_t > const &  elemToNodes,
arrayView1d< pmet_idx_t const > const &  elemDist,
MPI_Comm  comm,
int const  minCommonNodes 
)

Convert a element-node mesh map into a dual (element-element) graph.

Parameters
elemToNodesthe input mesh represented by its elem-node map
elemDistthe parallel distribution of elements: element index offset on each rank
commthe MPI communicator of processes to partition over
minCommonNodesminimum number of shared nodes to create an graph edge
Returns
a graph with an edge for every pair of elements that share at least minCommonNodes nodes; target element indices are global with respect to offsets in elemDist.
Note
elemDist must be a comm-wide exclusive scan of elemToNodes.size(); the user may compute it once and reuse in a subsequent call to partition().

◆ partition()

array1d< pmet_idx_t > geos::parmetis::partition ( ArrayOfArraysView< pmet_idx_t const, pmet_idx_t > const &  graph,
arrayView1d< pmet_idx_t const > const &  vertDist,
pmet_idx_t const  numParts,
MPI_Comm  comm,
int const  numRefinements 
)

Partition a mesh according to its dual graph.

Parameters
graphthe input graph (edges of locally owned nodes)
vertDistthe parallel distribution of vertices: vertex index offset on each rank
numPartstarget number of partitions
commthe MPI communicator of processes to partition over
numRefinementsnumber of partition refinement iterations
Returns
an array of target partitions for each element in local mesh