![]() |
Block-Structured AMR Software Framework
|
Binds a Krylov solver to an SpMatrix. More...
#include <AMReX_KrylovMV.H>
Public Types | |
| using | RT = T |
| using | VEC = AlgVector< T > |
| using | MAT = SpMatrix< T > |
| using | Solver = S< VEC, KrylovMV< S, T > > |
| using | GM = Solver |
| using | PC = std::function< void(VEC &, VEC const &)> |
Public Member Functions | |
| KrylovMV (MAT const *a_mat) | |
Bind the solver to a sparse matrix described by a_mat. | |
| ~KrylovMV ()=default | |
| KrylovMV (const KrylovMV &)=delete | |
| KrylovMV (KrylovMV &&)=delete | |
| KrylovMV & | operator= (const KrylovMV &)=delete |
| KrylovMV & | operator= (KrylovMV &&)=delete |
| void | setPrecond (PC a_pc) |
| Supply an optional right-preconditioner functor. | |
| void | solve (VEC &a_sol, VEC const &a_rhs, T a_tol_rel, T a_tol_abs) |
| Solve the linear system. | |
| void | setVerbose (int v) |
Set verbosity level v for the underlying solver. | |
| Solver & | getSolver () |
| Access the underlying solver for additional settings and results. | |
| Solver & | getGMRES () |
| Same as getSolver(), for GMRES_MV only. | |
| VEC | makeVecRHS () const |
| Return an AlgVector that mirrors the matrix partition for RHS storage. | |
| VEC | makeVecLHS () const |
| Return another AlgVector with the same partition for LHS storage. | |
| void | apply (VEC &lhs, VEC &rhs) const |
Apply the sparse operator: lhs = A rhs. | |
| void | precond (VEC &lhs, VEC const &rhs) const |
| Apply the optional preconditioner (or copy if none is provided). | |
Static Public Member Functions | |
| static T | norm2 (VEC const &vec) |
Euclidean norm of vec. | |
| static void | scale (VEC &vec, T scale_factor) |
Scale vec in place by scale_factor. | |
| static T | dotProduct (VEC const &vec1, VEC const &vec2) |
Dot product between vec1 and vec2. | |
| static void | setToZero (VEC &lhs) |
Reset lhs to zero. | |
| static void | assign (VEC &lhs, VEC const &rhs) |
Copy rhs into lhs. | |
| static void | increment (VEC &lhs, VEC const &rhs, T a) |
Accumulate lhs += a * rhs. | |
| static void | linComb (VEC &lhs, T a, VEC const &rhs_a, T b, VEC const &rhs_b) |
Form the linear combination lhs = a * rhs_a + b * rhs_b. | |
Binds a Krylov solver to an SpMatrix.
| S | Krylov solver class template with the GMRES operator interface, e.g., GMRES, BiCGStab or PCG. |
| T | Value type of the matrix and vectors (double or float). |
Use the aliases GMRES_MV, BiCGStab_MV and PCG_MV.
| using amrex::KrylovMV< S, T >::GM = Solver |
| using amrex::KrylovMV< S, T >::MAT = SpMatrix<T> |
| using amrex::KrylovMV< S, T >::PC = std::function<void(VEC&,VEC const&)> |
| using amrex::KrylovMV< S, T >::RT = T |
| using amrex::KrylovMV< S, T >::Solver = S<VEC,KrylovMV<S,T> > |
| using amrex::KrylovMV< S, T >::VEC = AlgVector<T> |
| amrex::KrylovMV< S, T >::KrylovMV | ( | MAT const * | a_mat | ) |
Bind the solver to a sparse matrix described by a_mat.
| a_mat | Matrix supplying the SpMV operation and partition. |
|
default |
|
delete |
|
delete |
| void amrex::KrylovMV< S, T >::apply | ( | VEC & | lhs, |
| VEC & | rhs | ||
| ) | const |
Apply the sparse operator: lhs = A rhs.
rhs is non-const to satisfy the solver interface.
|
static |
Copy rhs into lhs.
|
static |
Dot product between vec1 and vec2.
|
inline |
Same as getSolver(), for GMRES_MV only.
|
inline |
Access the underlying solver for additional settings and results.
|
static |
Accumulate lhs += a * rhs.
|
static |
Form the linear combination lhs = a * rhs_a + b * rhs_b.
| auto amrex::KrylovMV< S, T >::makeVecLHS | ( | ) | const |
Return another AlgVector with the same partition for LHS storage.
| auto amrex::KrylovMV< S, T >::makeVecRHS | ( | ) | const |
Return an AlgVector that mirrors the matrix partition for RHS storage.
|
static |
Euclidean norm of vec.
|
delete |
|
delete |
| void amrex::KrylovMV< S, T >::precond | ( | VEC & | lhs, |
| VEC const & | rhs | ||
| ) | const |
Apply the optional preconditioner (or copy if none is provided).
|
static |
Scale vec in place by scale_factor.
|
inline |
Supply an optional right-preconditioner functor.
The functor must follow the signature void(VEC& lhs, VEC const& rhs).
| a_pc | Callable that computes lhs = P^{-1}(rhs). |
|
static |
Reset lhs to zero.
|
inline |
Set verbosity level v for the underlying solver.
| void amrex::KrylovMV< S, T >::solve | ( | VEC & | a_sol, |
| VEC const & | a_rhs, | ||
| T | a_tol_rel, | ||
| T | a_tol_abs | ||
| ) |
Solve the linear system.
| a_sol | unknowns, i.e., x in A x = b. |
| a_rhs | RHS, i.e., b in A x = b. |
| a_tol_rel | relative tolerance. |
| a_tol_abs | absolute tolerance. |