peclet-amr 0.2.0
Block-local-Morton AMR octree + collocated cut-cell Navier–Stokes solver (header-only C++20, Kokkos + MPI)
Loading...
Searching...
No Matches
peclet::amr::GradedDistributedMultigrid< Dim, Bits > Class Template Reference

Geometric-multigrid V-cycle on a graded distributed octree, built on DistributedFvOperator. More...

#include <distributed_fv.hpp>

Public Types

using DO = DistributedOctree<Dim, Bits>
using BO = typename DO::Octree
using M = typename DO::M

Public Member Functions

void build (const DO &finest)
 Build the hierarchy from an already-graded, 2:1-balanced finest octree (openness-free; the coarsest is chained to the uniform DistributedMultigrid).
template<class OpenFn>
void build (const DO &finest, OpenFn &&openFn)
 Build with cut-cell openness openFn on every level (each level re-samples the geometry at its own face centroids — a rediscretized coarse operator).
std::size_t numLevels () const
DistributedFvOperator< 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 innerCycles=6, double omega=0.8, std::size_t L=0)
 One V-cycle of L u = rhs on level L (default finest), correction scheme.

Detailed Description

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

Geometric-multigrid V-cycle on a graded distributed octree, built on DistributedFvOperator.

The hierarchy keeps the same ORB blocks and coarsens each rank's local octree (coarsenIf, which never merges the root brick — it is guarded by level < lmax — so every rank stops at the uniform root brick and no cross-block re-decomposition is needed). 2:1 grading is preserved by uniform coarsening; the consistent per-level operator handles whatever grading remains. Ranks reach the root brick after DIFFERENT numbers of coarsening steps (deep vs shallow blocks), so the level count is padded to the global max with identity root-brick levels — otherwise the per-level collective gather deadlocks at np>1 (see buildImpl).

Transfers are local: a fine leaf's covering coarse leaf is in the same block (parents never cross root cells), so restriction (average children) and prolongation (piecewise-constant) need no communication — only the per-level Jacobi smoother uses the operator's ghost halo. Jacobi + local transfers are all order-independent / per-cell ⇒ the V-cycle is bit-identical COMM_WORLD vs COMM_SELF. The coarsest level (uniform root brick) is solved with extra Jacobi.

Definition at line 416 of file distributed_fv.hpp.

Member Typedef Documentation

◆ DO

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
using peclet::amr::GradedDistributedMultigrid< Dim, Bits >::DO = DistributedOctree<Dim, Bits>

Definition at line 418 of file distributed_fv.hpp.

◆ BO

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
using peclet::amr::GradedDistributedMultigrid< Dim, Bits >::BO = typename DO::Octree

Definition at line 419 of file distributed_fv.hpp.

◆ M

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
using peclet::amr::GradedDistributedMultigrid< Dim, Bits >::M = typename DO::M

Definition at line 420 of file distributed_fv.hpp.

Member Function Documentation

◆ build() [1/2]

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
void peclet::amr::GradedDistributedMultigrid< Dim, Bits >::build ( const DO & finest)
inline

Build the hierarchy from an already-graded, 2:1-balanced finest octree (openness-free; the coarsest is chained to the uniform DistributedMultigrid).

Definition at line 424 of file distributed_fv.hpp.

◆ build() [2/2]

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
template<class OpenFn>
void peclet::amr::GradedDistributedMultigrid< Dim, Bits >::build ( const DO & finest,
OpenFn && openFn )
inline

Build with cut-cell openness openFn on every level (each level re-samples the geometry at its own face centroids — a rediscretized coarse operator).

The chained uniform bottom solve is openness-free, so for openness the coarsest is bottom-solved with Jacobi on the (correct, openness-carrying) coarsest operator.

Definition at line 433 of file distributed_fv.hpp.

◆ numLevels()

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

Definition at line 523 of file distributed_fv.hpp.

◆ op()

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

Definition at line 524 of file distributed_fv.hpp.

◆ numLeaves()

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

Definition at line 525 of file distributed_fv.hpp.

◆ vcycle()

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

One V-cycle of L u = rhs on level L (default finest), correction scheme.

The coarsest (uniform root brick) is solved by innerCycles V-cycles of the uniform DistributedMultigrid on the root grid.

Definition at line 530 of file distributed_fv.hpp.

References vcycle().

Referenced by vcycle().


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