OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
openswmm::twoD::HypreAmgPreconditioner Class Reference

BoomerAMG preconditioner over the 2D diffusion Newton matrix. More...

#include <HypreAmgPreconditioner.hpp>

Collaboration diagram for openswmm::twoD::HypreAmgPreconditioner:

Public Member Functions

 HypreAmgPreconditioner ()=default
 
 ~HypreAmgPreconditioner ()
 
 HypreAmgPreconditioner (const HypreAmgPreconditioner &)=delete
 
HypreAmgPreconditioneroperator= (const HypreAmgPreconditioner &)=delete
 
void initialize (const MeshData &mesh)
 
void setup (const MeshData &mesh, const SurfaceStateData &state, double gamma, bool recompute=true)
 
void solve (const double *r, double *z, int n)
 Apply one BoomerAMG V-cycle: z ≈ M⁻¹ r (n entries each).
 
void finalize ()
 Release all hypre objects.
 
bool ready () const noexcept
 
bool hierarchyBuilt () const noexcept
 True once the multigrid hierarchy has been built at least once.
 
void invalidate () noexcept
 

Detailed Description

BoomerAMG preconditioner over the 2D diffusion Newton matrix.

Constructor & Destructor Documentation

◆ HypreAmgPreconditioner() [1/2]

openswmm::twoD::HypreAmgPreconditioner::HypreAmgPreconditioner ( )
default
Here is the caller graph for this function:

◆ ~HypreAmgPreconditioner()

openswmm::twoD::HypreAmgPreconditioner::~HypreAmgPreconditioner ( )
Here is the call graph for this function:

◆ HypreAmgPreconditioner() [2/2]

openswmm::twoD::HypreAmgPreconditioner::HypreAmgPreconditioner ( const HypreAmgPreconditioner & )
delete
Here is the call graph for this function:

Member Function Documentation

◆ finalize()

void openswmm::twoD::HypreAmgPreconditioner::finalize ( )

Release all hypre objects.

Here is the caller graph for this function:

◆ 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().

Here is the call graph for this function:

◆ 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=()

HypreAmgPreconditioner & openswmm::twoD::HypreAmgPreconditioner::operator= ( const HypreAmgPreconditioner & )
delete
Here is the call graph for this function:

◆ 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: