|
peclet-amr 0.2.0
Block-local-Morton AMR octree + collocated cut-cell Navier–Stokes solver (header-only C++20, Kokkos + MPI)
|
The agglomerated exact bottom of the pressure multigrid (docs/amr_mg_depth.md §6.6): the coarsest level's FV Laplacian assembled as the SPD matrix S = −Vol·L, with identity rows for fully closed cells and the constant nullspace projected per connected fluid component, solved by GraphAMG-preconditioned CG to relative kTol = 1e-10 (cap kMaxIters = 100).
More...
#include <amg_bottom.hpp>
Public Types | |
| using | Poisson = AmrPoisson< Dim, Bits > |
| the level operator the matrix is assembled from | |
Public Member Functions | |
| void | build (const Poisson &ap, bool singular) |
| Assemble S from the coarsest level's AmrPoisson and build the GraphAMG hierarchy. | |
| bool | ready () const |
True once build() has assembled a non-empty level. | |
| bool | onDevice () const |
Whether the per-V-cycle solve runs on the device (size() > kHostMax). | |
| Index | size () const |
| Rows of the bottom matrix = cells of the coarsest level. | |
| Index | numIdentityRows () const |
| Fully closed cells (every face openness 0), solved as identity rows with solution 0. | |
| int | numComponents () const |
| Connected fluid components; each carries its own constant nullspace mode. | |
| int | lastIters () const |
CG iterations of the last solve (0 for a zero right-hand side). | |
| double | lastRelResidual () const |
| ‖rhs − S x‖∞ / ‖rhs‖∞ of the last solve, measured on the CSR the bottom itself assembled. | |
| void | solve (View< const double > b, View< double > x) const |
| x ← the solution of L x = b on the coarsest level, i.e. | |
Static Public Attributes | |
| static constexpr Index | kHostMax = 10000 |
| Above this many rows the per-V-cycle solve runs on the device (§5.5). | |
The agglomerated exact bottom of the pressure multigrid (docs/amr_mg_depth.md §6.6): the coarsest level's FV Laplacian assembled as the SPD matrix S = −Vol·L, with identity rows for fully closed cells and the constant nullspace projected per connected fluid component, solved by GraphAMG-preconditioned CG to relative kTol = 1e-10 (cap kMaxIters = 100).
Owned by Multigrid (single-rank, and therefore the replicated stage's continued ladder) and by DistributedFlowMultigrid at np = 1; selected by Multigrid::setBottom — ‘Flow.set_pressure_bottom('auto’ | 'smoother' | 'agglomerated'). It changes the preconditioner, never the converged pressure. LOCAL: no MPI anywhere in the class — a replicated tail runs one identical copy per rank. Setup is host, once perbuild(); the per-V-cycle solve is host or device by size (kHostMax`). Throws nothing of its own.
Definition at line 63 of file amg_bottom.hpp.
| using peclet::amr::AmgBottom< Dim, Bits >::Poisson = AmrPoisson<Dim, Bits> |
the level operator the matrix is assembled from
Definition at line 65 of file amg_bottom.hpp.
Assemble S from the coarsest level's AmrPoisson and build the GraphAMG hierarchy.
singular = the operator has a constant nullspace per connected fluid component (the periodic pure-Neumann pressure, which is every AmrFlow path).
Definition at line 73 of file amg_bottom.hpp.
References peclet::amr::AmrPoisson< Dim, Bits >::assembleFv(), peclet::amr::AmgBottom< Dim, Bits >::kHostMax, and peclet::amr::transferFieldGradients().
|
inline |
True once build() has assembled a non-empty level.
Definition at line 126 of file amg_bottom.hpp.
|
inline |
Whether the per-V-cycle solve runs on the device (size() > kHostMax).
Definition at line 128 of file amg_bottom.hpp.
|
inline |
Rows of the bottom matrix = cells of the coarsest level.
Definition at line 130 of file amg_bottom.hpp.
|
inline |
Fully closed cells (every face openness 0), solved as identity rows with solution 0.
Definition at line 132 of file amg_bottom.hpp.
|
inline |
Connected fluid components; each carries its own constant nullspace mode.
Definition at line 134 of file amg_bottom.hpp.
|
inline |
CG iterations of the last solve (0 for a zero right-hand side).
Definition at line 136 of file amg_bottom.hpp.
|
inline |
‖rhs − S x‖∞ / ‖rhs‖∞ of the last solve, measured on the CSR the bottom itself assembled.
The V-cycle's own FvOp check (the §6.6 consistency gate) lives in Multigrid::vcycle and is the one §10 quotes.
Definition at line 140 of file amg_bottom.hpp.
|
inline |
x ← the solution of L x = b on the coarsest level, i.e.
S x = −b/invVol, projected onto the complement of the per-component nullspace. Device views, which may be LONGER than size() (the distributed levels carry a ghost tail); only the first size() rows are read and written, and everything runs through this class's own scratch so a subview is never needed.
Definition at line 146 of file amg_bottom.hpp.
References peclet::amr::transferFieldGradients().
|
staticconstexpr |
Above this many rows the per-V-cycle solve runs on the device (§5.5).
Definition at line 68 of file amg_bottom.hpp.
Referenced by peclet::amr::AmgBottom< Dim, Bits >::build().