|
WarpX
|
Top-level class for the linear solver. More...
#include <LinearSolver.H>
Public Types | |
| using | RT = typename Ops::RT |
Public Member Functions | |
| LinearSolver ()=default | |
| virtual | ~LinearSolver ()=default |
| LinearSolver (const LinearSolver &)=delete | |
| LinearSolver & | operator= (const LinearSolver &)=delete |
| LinearSolver (LinearSolver &&) noexcept=delete | |
| LinearSolver & | operator= (LinearSolver &&) noexcept=delete |
| virtual void | define (Ops &linop)=0 |
| virtual void | solve (Vec &a_sol, Vec const &a_rhs, RT a_tol_rel, RT a_tol_abs, int a_its=-1)=0 |
| Solve the linear system. | |
| virtual void | setVerbose (int v)=0 |
| Sets verbosity. | |
| virtual void | setRestartLength (int rl) |
| virtual void | setMaxIters (int niters)=0 |
| Sets the max number of iterations. | |
| virtual int | getNumIters () const =0 |
| Gets the number of iterations. | |
| virtual int | getStatus () const =0 |
| Gets the solver status. | |
| virtual RT | getResidualNorm () const =0 |
| Gets the 2-norm of the residual. | |
Top-level class for the linear solver.
This class is templated on a vector class Vec, and an operator class Ops.
The Ops class must have the following function: ComputeRHS( R_vec, U_vec, time, nl_iter, from_jacobian ), where U_vec and R_vec are of type Vec.
The Vec class must have basic math operators, such as Copy, +=, -=, increment(), linComb(), scale(), etc.. See WarpXSolverVec.H for an example.
| using LinearSolver< Vec, Ops >::RT = typename Ops::RT |
|
default |
|
virtualdefault |
|
delete |
|
deletenoexcept |
|
pure virtual |
Defines with a reference to Ops. It's the user's responsibility to keep the Ops object alive for linear solver to be functional. This function must be called before solve() can be called.
Implemented in AMReXGMRES< Vec, Ops >.
|
pure virtual |
Gets the number of iterations.
Implemented in AMReXGMRES< Vec, Ops >.
|
pure virtual |
Gets the 2-norm of the residual.
Implemented in AMReXGMRES< Vec, Ops >.
|
pure virtual |
Gets the solver status.
Implemented in AMReXGMRES< Vec, Ops >.
|
delete |
|
deletenoexcept |
|
pure virtual |
Sets the max number of iterations.
Implemented in AMReXGMRES< Vec, Ops >.
|
inlinevirtual |
Sets restart length for GMRES-like solvers. Base implementation provided for solvers that don't need this.
Reimplemented in AMReXGMRES< Vec, Ops >.
|
pure virtual |
Sets verbosity.
Implemented in AMReXGMRES< Vec, Ops >.
|
pure virtual |
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. |
| a_its | optional argument specifying the maximum number of iterations. |
Implemented in AMReXGMRES< Vec, Ops >.