BoomerAMG preconditioner over the 2D diffusion Newton matrix.
More...
#include <HypreAmgPreconditioner.hpp>
BoomerAMG preconditioner over the 2D diffusion Newton matrix.
◆ HypreAmgPreconditioner() [1/2]
| openswmm::twoD::HypreAmgPreconditioner::HypreAmgPreconditioner |
( |
| ) |
|
|
default |
◆ ~HypreAmgPreconditioner()
| openswmm::twoD::HypreAmgPreconditioner::~HypreAmgPreconditioner |
( |
| ) |
|
◆ HypreAmgPreconditioner() [2/2]
◆ finalize()
| void openswmm::twoD::HypreAmgPreconditioner::finalize |
( |
| ) |
|
Release all hypre objects.
◆ hierarchyBuilt()
| bool openswmm::twoD::HypreAmgPreconditioner::hierarchyBuilt |
( |
| ) |
const |
|
inlinenoexcept |
True once the multigrid hierarchy has been built at least once.
◆ initialize()
| void openswmm::twoD::HypreAmgPreconditioner::initialize |
( |
const MeshData & | mesh | ) |
|
Build the static CSR sparsity and allocate the hypre IJ matrix/vectors for an n-cell mesh. Call once per solver initialize().
◆ invalidate()
| void openswmm::twoD::HypreAmgPreconditioner::invalidate |
( |
| ) |
|
|
inlinenoexcept |
Drop the lagged-reuse cache: the next setup() rebuilds the matrix and hierarchy regardless of the recompute flag. Call after the solver state is re-seeded (CVodeReInit).
◆ operator=()
◆ ready()
| bool openswmm::twoD::HypreAmgPreconditioner::ready |
( |
| ) |
const |
|
inlinenoexcept |
◆ setup()
| void openswmm::twoD::HypreAmgPreconditioner::setup |
( |
const MeshData & | mesh, |
|
|
const SurfaceStateData & | state, |
|
|
double | gamma, |
|
|
bool | recompute = true ) |
Assemble M = I − γ·J from the current state and (re)build the AMG hierarchy. CVODE decides the cadence (lagged) via its psetup policy.
When recompute is false AND a hierarchy already exists this is a no-op: the previously built matrix + multigrid hierarchy are reused (CVODE passed jok == SUNTRUE — the saved Jacobian is still current and only γ drifted). GMRES preconditions with the true matrix-free operator, so a slightly stale hierarchy only affects the Krylov iteration count, never the converged solution. The first call always builds.
◆ solve()
| void openswmm::twoD::HypreAmgPreconditioner::solve |
( |
const double * | r, |
|
|
double * | z, |
|
|
int | n ) |
Apply one BoomerAMG V-cycle: z ≈ M⁻¹ r (n entries each).
The documentation for this class was generated from the following files: