Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website
Loading...
Searching...
No Matches
partition.h File Reference

Cell partitioning for distributed runs. More...

#include <array>
#include <cstdint>
#include <vector>
#include "common_typedef.h"

Go to the source code of this file.

Functions

uint64_t hilbert_key (const std::array< double, N_DIM > &x, const std::array< double, N_DIM > &lo, const std::array< double, N_DIM > &hi)
 Position along the Hilbert curve of a point in the box [lo, hi] (any dimension; 63 / N_DIM bits per axis).
 
std::vector< int > partition_hilbert (const DistributedMesh &mesh, int n_parts)
 Owner rank of every block cell of a distributed mesh: cells sorted along the Hilbert curve of their vertex averages (ties by global id) by a distributed sample sort, split into n_parts contiguous pieces of nearly equal size (collective).
 
std::array< int, N_DIM > grid_shape (int n_parts, const std::array< double, N_DIM > &extent)
 Parts per axis of the grid of n_parts blocks of a box with these extents that has the least total area between blocks.
 
std::vector< int > partition_multijagged (const DistributedMesh &mesh, int n_parts)
 Owner rank of every block cell of a distributed mesh by multi-jagged coordinate partitioning (collective): the cells, keyed by the coordinates of their vertex averages (ties by global id), are split along x into equal slabs, each slab along y, and so on, with the number of pieces per axis from grid_shape() on their bounding box. A box of cuboid cells gives cuboid parts.
 
std::vector< int > partition_graph (const DistributedMesh &mesh, int n_parts)
 Owner rank of every block cell of a distributed mesh from dKaMinPar on its dual graph (collective). Requires Mallard_ENABLE_KAMINPAR.
 
bool have_graph_partitioner ()
 Whether this build has a graph partitioner.
 

Detailed Description

Cell partitioning for distributed runs.

Author
Matthew Bonanni (mbona.nosp@m.nni0.nosp@m.01@gm.nosp@m.ail..nosp@m.com)
Version
0.3
Date
2026-10-02

Function Documentation

◆ grid_shape()

std::array< int, N_DIM > grid_shape ( int  n_parts,
const std::array< double, N_DIM > &  extent 
)

Parts per axis of the grid of n_parts blocks of a box with these extents that has the least total area between blocks.

◆ have_graph_partitioner()

bool have_graph_partitioner ( )

Whether this build has a graph partitioner.

◆ hilbert_key()

uint64_t hilbert_key ( const std::array< double, N_DIM > &  x,
const std::array< double, N_DIM > &  lo,
const std::array< double, N_DIM > &  hi 
)

Position along the Hilbert curve of a point in the box [lo, hi] (any dimension; 63 / N_DIM bits per axis).

◆ partition_graph()

std::vector< int > partition_graph ( const DistributedMesh &  mesh,
int  n_parts 
)

Owner rank of every block cell of a distributed mesh from dKaMinPar on its dual graph (collective). Requires Mallard_ENABLE_KAMINPAR.

◆ partition_hilbert()

std::vector< int > partition_hilbert ( const DistributedMesh &  mesh,
int  n_parts 
)

Owner rank of every block cell of a distributed mesh: cells sorted along the Hilbert curve of their vertex averages (ties by global id) by a distributed sample sort, split into n_parts contiguous pieces of nearly equal size (collective).

◆ partition_multijagged()

std::vector< int > partition_multijagged ( const DistributedMesh &  mesh,
int  n_parts 
)

Owner rank of every block cell of a distributed mesh by multi-jagged coordinate partitioning (collective): the cells, keyed by the coordinates of their vertex averages (ties by global id), are split along x into equal slabs, each slab along y, and so on, with the number of pieces per axis from grid_shape() on their bounding box. A box of cuboid cells gives cuboid parts.