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, measured against m_residualScale.
|
| |
|
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 = 0.0 |
| | Norm that both the printed residual and the convergence test are measured against.
|
| |
|
|
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
Norm that both the printed residual and the convergence test are measured against.
The driver sets this to the zero-residual ||r_zero|| = ||rhs - L(0)||, which is the scale the hosting solver itself uses to decide whether a solution has converged. Measuring the exit test on that same scale is what makes m_eps mean the same thing here as it does to the caller, and is also what lets a warm start pay for itself: scaling the tolerance by this solve's own initial residual instead would demand the same reduction factor no matter how good the initial guess was. A non-positive value falls back to this solve's initial residual norm, which is the right scale when there is no host to agree with.
The documentation for this class was generated from the following files: