core
Shared MPI block decomposition + asynchronous ghost-layer exchange (header-only C++20)
Loading...
Searching...
No Matches
peclet::core::amr::DistributedMultigrid< Dim, Bits > Class Template Reference

Distributed geometric-multigrid V-cycle for the plain Laplacian on a uniform (lmax==0) octree, the distributed analog of the host AmrMultigrid + flow's MPI-folded CutcellMG. More...

#include <distributed_poisson.hpp>

Public Member Functions

void build (const IVec< Dim > &g0, const AmrGeometry< Dim > &geo, const std::array< bool, Dim > &periodic, MPI_Comm comm)
 Build the hierarchy from the finest global root grid g0 (lmax==0) on comm.
 
std::size_t numLevels () const
 
DistributedOctree< Dim, Bits > & octree (std::size_t L=0)
 
DistributedPoisson< Dim, Bits > & op (std::size_t L=0)
 
Index numLeaves (std::size_t L=0) const
 
void vcycle (std::vector< double > &x, const std::vector< double > &b, int pre=2, int post=2, int bottom=30, std::size_t L=0)
 One V-cycle of A x = b on level L (default the finest), correction scheme.
 

Detailed Description

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
class peclet::core::amr::DistributedMultigrid< Dim, Bits >

Distributed geometric-multigrid V-cycle for the plain Laplacian on a uniform (lmax==0) octree, the distributed analog of the host AmrMultigrid + flow's MPI-folded CutcellMG.

The hierarchy is a stack of DistributedOctrees on the successively halved global root grid, each ORB-decomposed over the same comm.

The decompositions nest: for a power-of-two grid and rank count, ORB bisects at proportional positions, so rank r's coarse block is exactly its fine block halved. Hence every fine cell's parent is owned by the same rank — restriction and prolongation are purely local (no comm); only the Jacobi smoother needs the per-level halo. build() asserts this nesting (each c2p entry resolves locally).

Jacobi smoother + local averaging restriction + piecewise-constant prolongation are all order-independent / per-cell, so the whole V-cycle is bit-identical across rank counts (COMM_WORLD == COMM_SELF), the suite's distributed-validation contract.

Definition at line 142 of file distributed_poisson.hpp.

Member Function Documentation

◆ build()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
void peclet::core::amr::DistributedMultigrid< Dim, Bits >::build ( const IVec< Dim > &  g0,
const AmrGeometry< Dim > &  geo,
const std::array< bool, Dim > &  periodic,
MPI_Comm  comm 
)
inline

Build the hierarchy from the finest global root grid g0 (lmax==0) on comm.

Coarsens by halving until an axis would drop below 2 or the cell count below the rank count. geo.h0 is the finest spacing; coarser levels use 2^k·h0.

Definition at line 147 of file distributed_poisson.hpp.

References MPI_Comm_size().

◆ numLevels()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
std::size_t peclet::core::amr::DistributedMultigrid< Dim, Bits >::numLevels ( ) const
inline

Definition at line 194 of file distributed_poisson.hpp.

◆ octree()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
DistributedOctree< Dim, Bits > & peclet::core::amr::DistributedMultigrid< Dim, Bits >::octree ( std::size_t  L = 0)
inline

Definition at line 195 of file distributed_poisson.hpp.

◆ op()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
DistributedPoisson< Dim, Bits > & peclet::core::amr::DistributedMultigrid< Dim, Bits >::op ( std::size_t  L = 0)
inline

◆ numLeaves()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
Index peclet::core::amr::DistributedMultigrid< Dim, Bits >::numLeaves ( std::size_t  L = 0) const
inline

Definition at line 197 of file distributed_poisson.hpp.

◆ vcycle()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
void peclet::core::amr::DistributedMultigrid< Dim, Bits >::vcycle ( std::vector< double > &  x,
const std::vector< double > &  b,
int  pre = 2,
int  post = 2,
int  bottom = 30,
std::size_t  L = 0 
)
inline

The documentation for this class was generated from the following file: