|
WarpX
|
Picard fixed-point iteration method to solve nonlinear equation of form: U = b + R(U). U is the solution vector. b is a constant. R(U) is some nonlinear function of U, which is computed in the Ops function ComputeRHS(). More...
#include <PicardSolver.H>
Public Member Functions | |
| PicardSolver ()=default | |
| ~PicardSolver () override=default | |
| PicardSolver (const PicardSolver &)=delete | |
| PicardSolver & | operator= (const PicardSolver &)=delete |
| PicardSolver (PicardSolver &&) noexcept=delete | |
| PicardSolver & | operator= (PicardSolver &&) noexcept=delete |
| void | Define (const Vec &a_U, Ops *a_ops) override |
| Read user-provided parameters that control the nonlinear solver. Allocate intermediate data containers needed by the solver. For Newton, setup the linear solver for computing the Newton step. | |
| void | Solve (Vec &a_U, const Vec &a_b, amrex::Real a_time, amrex::Real a_dt, int a_step) const override |
| Solve the specified nonlinear equation for U. Picard: U = b + R(U). Newton: F(U) = U - b - R(U) = 0. | |
| void | GetSolverParams (amrex::Real &a_rtol, amrex::Real &a_atol, int &a_maxits) override |
| Return the convergence parameters used by the nonlinear solver. | |
| void | PrintParams () const override |
| Print parameters used by the nonlinear solver. | |
Public Member Functions inherited from NonlinearSolver< Vec, Ops > | |
| NonlinearSolver ()=default | |
| virtual | ~NonlinearSolver ()=default |
| NonlinearSolver (const NonlinearSolver &)=delete | |
| NonlinearSolver & | operator= (const NonlinearSolver &)=delete |
| NonlinearSolver (NonlinearSolver &&) noexcept=delete | |
| NonlinearSolver & | operator= (NonlinearSolver &&) noexcept=delete |
| bool | IsDefined () const |
| Check if the nonlinear solver has been defined. | |
| virtual bool | UsePreconditioner () |
| Whether a preconditioner is used by the nonlinear solver. | |
| void | Verbose (bool a_verbose) |
| Allow caller to dynamically change the verbosity flag. For example, one may want to only print solver information every 100 steps. | |
Private Member Functions | |
| void | ParseParameters () |
Private Attributes | |
| Vec | m_Usave |
| Intermediate Vec containers used by the solver. | |
| Vec | m_R |
| Ops * | m_ops = nullptr |
| Pointer to Ops class. | |
| bool | m_require_convergence = true |
| Flag to determine whether convergence is required. | |
| amrex::Real | m_rtol = 1.0e-6 |
| Relative tolerance for the Picard nonlinear solver. | |
| amrex::Real | m_atol = 0. |
| Absolute tolerance for the Picard nonlinear solver. | |
| int | m_maxits = 100 |
| Maximum iterations for the Picard nonlinear solver. | |
| int | m_total_iters = 0 |
| Total iterations for the diagnostic file. | |
Additional Inherited Members | |
Protected Attributes inherited from NonlinearSolver< Vec, Ops > | |
| bool | m_is_defined = false |
| bool | m_verbose = true |
| std::string | m_diagnostic_file |
| int | m_diagnostic_interval = 1 |
| bool | m_usePC = false |
Picard fixed-point iteration method to solve nonlinear equation of form: U = b + R(U). U is the solution vector. b is a constant. R(U) is some nonlinear function of U, which is computed in the Ops function ComputeRHS().
|
default |
|
overridedefault |
|
delete |
|
deletenoexcept |
|
overridevirtual |
Read user-provided parameters that control the nonlinear solver. Allocate intermediate data containers needed by the solver. For Newton, setup the linear solver for computing the Newton step.
Implements NonlinearSolver< Vec, Ops >.
|
inlineoverridevirtual |
Return the convergence parameters used by the nonlinear solver.
Implements NonlinearSolver< Vec, Ops >.
|
delete |
|
deletenoexcept |
|
private |
|
inlineoverridevirtual |
Print parameters used by the nonlinear solver.
Implements NonlinearSolver< Vec, Ops >.
|
overridevirtual |
Solve the specified nonlinear equation for U. Picard: U = b + R(U). Newton: F(U) = U - b - R(U) = 0.
Implements NonlinearSolver< Vec, Ops >.
|
private |
Absolute tolerance for the Picard nonlinear solver.
|
private |
Maximum iterations for the Picard nonlinear solver.
|
private |
Pointer to Ops class.
|
private |
|
private |
Flag to determine whether convergence is required.
|
private |
Relative tolerance for the Picard nonlinear solver.
|
mutableprivate |
Total iterations for the diagnostic file.
|
mutableprivate |
Intermediate Vec containers used by the solver.