Preconditioned BiCGStab solver acting on an AMR hierarchy through AMRMultigridKrylovOp.
More...
#include <CD_KrylovBiCGStab.H>
|
|
| KrylovBiCGStab () noexcept=default |
| | Default constructor. Call define() before use.
|
| |
|
| ~KrylovBiCGStab () noexcept |
| | Destructor. Frees the persistent work vectors.
|
| |
| void | define (AMRMultigridKrylovOp< T > *a_op, const Vector< LevelData< T > * > &a_template) noexcept |
| | Allocate the persistent work vectors. Call once per regrid.
|
| |
|
void | undefine () noexcept |
| | Free the persistent work vectors.
|
| |
| bool | isDefined () const noexcept |
| | Whether define() has been called and the work vectors are allocated.
|
| |
| bool | solve (Vector< LevelData< T > * > &a_phi, const Vector< LevelData< T > * > &a_rhs) noexcept |
| | Solve a_op(a_phi) = a_rhs (homogeneous operator) with preconditioned BiCGStab.
|
| |
|
|
Real | m_eps = 1.E-10 |
| | Relative residual tolerance (against the initial residual norm).
|
| |
|
int | m_maxIter = 50 |
| | Maximum number of iterations.
|
| |
|
int | m_numRestarts = 5 |
| | Maximum number of restarts on breakdown.
|
| |
|
int | m_verbosity = -1 |
| | Verbosity; at >= 4 a terse one-line-per-iteration residual/rate history is printed.
|
| |
|
int | m_exitStatus = -1 |
| | Exit status after solve(): 1 = converged, 2 = breakdown, 3 = max iterations, -1 = not run.
|
| |
|
Real | m_residualNorm = -1.0 |
| | Final residual norm after solve() (in the adapter inner-product norm).
|
| |
|
int | m_iterations = 0 |
| | Number of iterations performed by the last solve().
|
| |
| Real | m_residualScale = 1.0 |
| | Display normalization for printed residuals (set to the zero-residual by the driver; 1 = print absolute).
|
| |
|
|
AMRMultigridKrylovOp< T > * | m_op = nullptr |
| | Operator/adapter (not owned).
|
| |
|
bool | m_isDefined = false |
| | Whether the work vectors are allocated.
|
| |
|
Vector< LevelData< T > * > | m_r |
| | Residual / s.
|
| |
|
Vector< LevelData< T > * > | m_rTilde |
| | Shadow residual.
|
| |
|
Vector< LevelData< T > * > | m_e |
| | Accumulated correction (added to a_phi at the end).
|
| |
|
Vector< LevelData< T > * > | m_p |
| | Search direction.
|
| |
|
Vector< LevelData< T > * > | m_pTilde |
| | Preconditioned search direction.
|
| |
|
Vector< LevelData< T > * > | m_sTilde |
| | Preconditioned s.
|
| |
|
Vector< LevelData< T > * > | m_t |
| | A*s_tilde.
|
| |
|
Vector< LevelData< T > * > | m_v |
| | A*p_tilde.
|
| |
template<class T>
class KrylovBiCGStab< T >
Preconditioned BiCGStab solver acting on an AMR hierarchy through AMRMultigridKrylovOp.
A chombo-discharge replacement for Chombo's BiCGStabSolver on the outer Krylov path, written for scale-out: the eight work vectors are allocated once in define() and reused across solves (no per-solve allocation), and the omega numerator/denominator inner products are fused into a single mDotProduct so the adapter issues one MPI reduction instead of two. The matrix-vector product and preconditioner are the homogeneous AMR operator and multigrid cycle supplied by the adapter; solve() updates the solution in place and honours a non-zero initial guess (warm start).
- Note
- T is the FAB type (EBCellFAB or MFCellFAB).
◆ define()
Allocate the persistent work vectors. Call once per regrid.
- Parameters
-
| [in] | a_op | The (already define()d) operator/adapter to solve against |
| [in] | a_template | A hierarchy whose layout the work vectors mirror (e.g. the rhs) |
◆ isDefined()
Whether define() has been called and the work vectors are allocated.
- Returns
- True if defined.
◆ solve()
template<class T >
| bool KrylovBiCGStab< T >::solve |
( |
Vector< LevelData< T > * > & |
a_phi, |
|
|
const Vector< LevelData< T > * > & |
a_rhs |
|
) |
| |
|
noexcept |
Solve a_op(a_phi) = a_rhs (homogeneous operator) with preconditioned BiCGStab.
- Parameters
-
| [in,out] | a_phi | Solution (in: initial guess; out: solution). Warm starts are honoured. |
| [in] | a_rhs | Right-hand side. |
- Returns
- True if converged (m_exitStatus == 1).
◆ m_residualScale
Display normalization for printed residuals (set to the zero-residual by the driver; 1 = print absolute).
Affects only verbose output, not the convergence test. The printed value is the relative residual ||r|| / ||r_zero||, so progress is comparable across solvers regardless of their internal norm.
The documentation for this class was generated from the following files: