|
peclet-amr 0.2.0
Block-local-Morton AMR octree + collocated cut-cell Navier–Stokes solver (header-only C++20, Kokkos + MPI)
|
One stage of the pressure hierarchy (docs/amr_mg_depth.md §6.5). More...
#include <mg_stage.hpp>
Public Types | |
| using | Octree = BlockOctree< Dim, Bits > |
| a level's cells on one block | |
| using | Decomposition = core::decomp::BlockDecomposer< Dim > |
| the target partition's type | |
Public Member Functions | |
| virtual | ~MgStage ()=default |
| virtual const char * | kind () const =0 |
"replicated" | "sibling" | "repartition". | |
| virtual const char * | diagnosticSuffix () const =0 |
What pressure_mg_bottom appends for this stage — "+tail" for the replicated one, which is the spelling docs/amr_mg_depth.md §6.7 fixes. | |
| virtual const Decomposition & | targetDecomposition () const =0 |
| The decomposition of the moved level's grid this stage targets. | |
| virtual MPI_Comm | targetComm () const =0 |
| The communicator every collective of the continued ladder runs on. | |
| virtual bool | active () const =0 |
| Whether THIS rank owns a target block, i.e. | |
| virtual const Octree & | targetOctree () const =0 |
| The moved level's cells on this rank's target block. | |
| virtual std::size_t | numLevels () const =0 |
| Levels of the continued ladder, its level 0 (the moved level) included. Local. | |
| virtual Index | numLeaves (std::size_t L) const =0 |
Cells of continued-ladder level L on this rank's target block — the GLOBAL count for the replicated stage, whose one block is the whole level. | |
| virtual std::string | bottomName () const =0 |
"jacobi" | "amg": what solves the continued ladder's coarsest level, WITHOUT the stage's diagnosticSuffix() (the owner appends it). | |
| virtual void | setRemoveMean (bool on)=0 |
Per-level constant-nullspace projection for the singular periodic pressure; the owner forwards its own flag (DistributedFlowMultigrid::setRemoveMean). | |
| virtual void | setBottom (typename Multigrid< Dim, Bits >::Bottom b)=0 |
| What solves the continued ladder's coarsest level (docs/amr_mg_depth.md §6.6). | |
| virtual View< double > | targetX ()=0 |
The continued ladder's level-0 solution — what moveDown reads. | |
| virtual void | moveUp (View< const double > src, Index nSrc)=0 |
src (this rank's rows of the moved level, device; may be longer than nSrc) → the target's level-0 rhs. | |
| virtual void | cycle (int pre, int post, int bottom, double omega)=0 |
One cycle of the continued ladder on targetComm(). Called on active ranks only. | |
| virtual void | moveDown (View< double > dst, Index nDst)=0 |
The target's level-0 solution → the first nDst rows of dst. | |
| void | apply (View< const double > residual, View< double > correction, Index n, int pre, int post, int bottom, double omega) |
| The whole stage for one V-cycle, in the CORRECTION SCHEME §6.5 prescribes: the caller hands in the residual at resolution L and gets back a correction to ADD. | |
One stage of the pressure hierarchy (docs/amr_mg_depth.md §6.5).
The five things a stage IS — a target decomposition, a target communicator with an active flag, the moved fields, the level's cells on the target block as a BlockOctree, and the continued ladder below it — are the five accessors below; the two movement steps are the only part the instantiations differ in.
Owned by DistributedFlowMultigrid (at most one, built in its buildStage after the openness ladder) and driven from its vcycle through apply at the stage point; pressure_mg_levels and pressure_mg_bottom report it. Collective semantics are per method, below: movement is collective on the PARENT communicator, the continued ladder on targetComm().
Definition at line 60 of file mg_stage.hpp.
| using peclet::amr::MgStage< Dim, Bits >::Octree = BlockOctree<Dim, Bits> |
a level's cells on one block
Definition at line 62 of file mg_stage.hpp.
| using peclet::amr::MgStage< Dim, Bits >::Decomposition = core::decomp::BlockDecomposer<Dim> |
the target partition's type
Definition at line 63 of file mg_stage.hpp.
|
virtualdefault |
|
pure virtual |
"replicated" | "sibling" | "repartition".
Implemented in peclet::amr::DistributedStage< Dim, Bits >, and peclet::amr::ReplicatedTailStage< Dim, Bits >.
|
pure virtual |
What pressure_mg_bottom appends for this stage — "+tail" for the replicated one, which is the spelling docs/amr_mg_depth.md §6.7 fixes.
Implemented in peclet::amr::DistributedStage< Dim, Bits >, and peclet::amr::ReplicatedTailStage< Dim, Bits >.
|
pure virtual |
The decomposition of the moved level's grid this stage targets.
Implemented in peclet::amr::DistributedStage< Dim, Bits >, and peclet::amr::ReplicatedTailStage< Dim, Bits >.
|
pure virtual |
The communicator every collective of the continued ladder runs on.
Implemented in peclet::amr::DistributedStage< Dim, Bits >, and peclet::amr::ReplicatedTailStage< Dim, Bits >.
|
pure virtual |
Whether THIS rank owns a target block, i.e.
takes part in the continued ladder. Ranks that do not still take part in the MOVEMENT, on the parent communicator, and skip the recursion.
Implemented in peclet::amr::DistributedStage< Dim, Bits >, and peclet::amr::ReplicatedTailStage< Dim, Bits >.
Referenced by peclet::amr::MgStage< Dim, Bits >::apply().
|
pure virtual |
The moved level's cells on this rank's target block.
Implemented in peclet::amr::DistributedStage< Dim, Bits >, and peclet::amr::ReplicatedTailStage< Dim, Bits >.
|
pure virtual |
Levels of the continued ladder, its level 0 (the moved level) included. Local.
Implemented in peclet::amr::DistributedStage< Dim, Bits >, and peclet::amr::ReplicatedTailStage< Dim, Bits >.
|
pure virtual |
Cells of continued-ladder level L on this rank's target block — the GLOBAL count for the replicated stage, whose one block is the whole level.
Local.
Implemented in peclet::amr::DistributedStage< Dim, Bits >, and peclet::amr::ReplicatedTailStage< Dim, Bits >.
|
pure virtual |
"jacobi" | "amg": what solves the continued ladder's coarsest level, WITHOUT the stage's diagnosticSuffix() (the owner appends it).
Local.
Implemented in peclet::amr::DistributedStage< Dim, Bits >, and peclet::amr::ReplicatedTailStage< Dim, Bits >.
|
pure virtual |
Per-level constant-nullspace projection for the singular periodic pressure; the owner forwards its own flag (DistributedFlowMultigrid::setRemoveMean).
Local.
Implemented in peclet::amr::DistributedStage< Dim, Bits >, and peclet::amr::ReplicatedTailStage< Dim, Bits >.
|
pure virtual |
What solves the continued ladder's coarsest level (docs/amr_mg_depth.md §6.6).
The exact bottom lives in the single-rank Multigrid, so this is where the selector lands.
Implemented in peclet::amr::DistributedStage< Dim, Bits >, and peclet::amr::ReplicatedTailStage< Dim, Bits >.
|
pure virtual |
The continued ladder's level-0 solution — what moveDown reads.
A test uses it to assert the stage produced the same answer everywhere it is replicated (§11.2).
Implemented in peclet::amr::DistributedStage< Dim, Bits >, and peclet::amr::ReplicatedTailStage< Dim, Bits >.
|
pure virtual |
src (this rank's rows of the moved level, device; may be longer than nSrc) → the target's level-0 rhs.
Collective on the PARENT communicator: every rank takes part, active or not.
Implemented in peclet::amr::DistributedStage< Dim, Bits >, and peclet::amr::ReplicatedTailStage< Dim, Bits >.
Referenced by peclet::amr::MgStage< Dim, Bits >::apply().
|
pure virtual |
One cycle of the continued ladder on targetComm(). Called on active ranks only.
Implemented in peclet::amr::DistributedStage< Dim, Bits >, and peclet::amr::ReplicatedTailStage< Dim, Bits >.
Referenced by peclet::amr::MgStage< Dim, Bits >::apply().
|
pure virtual |
The target's level-0 solution → the first nDst rows of dst.
Implemented in peclet::amr::DistributedStage< Dim, Bits >, and peclet::amr::ReplicatedTailStage< Dim, Bits >.
Referenced by peclet::amr::MgStage< Dim, Bits >::apply().
|
inline |
The whole stage for one V-cycle, in the CORRECTION SCHEME §6.5 prescribes: the caller hands in the residual at resolution L and gets back a correction to ADD.
That is what makes the stage legal at every level, including L = 0 — where the level being moved is the finest one (no in-place lift was possible at all) and its iterate must not be thrown away. Where the stage fires below level 0 the incoming iterate is zero, so residual == rhs and add == overwrite, and this is bit-for-bit §6.5.1's simpler description.
Definition at line 117 of file mg_stage.hpp.
References peclet::amr::MgStage< Dim, Bits >::active(), peclet::amr::MgStage< Dim, Bits >::cycle(), peclet::amr::MgStage< Dim, Bits >::moveDown(), peclet::amr::MgStage< Dim, Bits >::moveUp(), and peclet::amr::transferFieldGradients().