core
Shared MPI block decomposition + asynchronous ghost-layer exchange (header-only C++20)
Loading...
Searching...
No Matches
peclet::core::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::core::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 380 of file distributed_fv.hpp.

Member Typedef Documentation

◆ DO

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

Definition at line 382 of file distributed_fv.hpp.

◆ BO

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

Definition at line 383 of file distributed_fv.hpp.

◆ M

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

Definition at line 384 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::core::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 388 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::core::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 397 of file distributed_fv.hpp.

◆ numLevels()

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

Definition at line 486 of file distributed_fv.hpp.

◆ op()

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

Definition at line 487 of file distributed_fv.hpp.

◆ numLeaves()

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

Definition at line 488 of file distributed_fv.hpp.

◆ vcycle()

template<int Dim, unsigned Bits = (Dim == 2 ? 32u : (Dim == 3 ? 21u : 16u))>
void peclet::core::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 493 of file distributed_fv.hpp.

References peclet::core::amr::GradedDistributedMultigrid< Dim, Bits >::vcycle().

Referenced by peclet::core::amr::GradedDistributedMultigrid< Dim, Bits >::vcycle().


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