#include <source/solvers/packages/petsc/SNES_SAMRAIContext.h>
Inheritance diagram for SAMRAI::solv::SNES_SAMRAIContext< DIM >:
This class declares five private static member functions to link user-defined routines for nonlinear residual calculation, Jacobian evaluation, preconditioner setup and solve, and Jacobian-vector product operations. The implementation of these functions is defined by the user in a subclass of the abstract base class SNESAbstractFunctions. The vector objects used within the solver are provided by the PETSc_SAMRAIVectorReal<DIM> wrapper class.
If no parameters are read from input, PETSc defaults are used. See the PETSc documentation (http://www-unix.mcs.anl.gov/petsc/). for more information on default parameters and SNES functionality.
Optional input keys and types that can be read by this class are:
Note that all input values may override values read in from restart. If no new input value is given, the restart value is used.
A sample input file entry might look like:
absolute_tolerance = 10.e-10
relative_tolerance = 10.e-6
step_tolerance = 10.e-8
maximum_nonlinear_iterations = 200
forcing_term_strategy = "EWCHOICE1"
Note that input values can also be set using accessor functions. Values that are set via this mechanism will be cached both in the solver context as well as in the corresponding PETSc object. Thus values changed on-the-fly will be written to restart. These input values can also be changed by directly accessing the corresponding PETSc object and using native PETSc function calls; however such settings/changes will NOT be cached in the solver context, and so will not be written to restart.
|
Constructor for SNES_SAMRAIContext<DIM> allocates the SNES object and initializes rudimentary state associated with user-supplied solver components. Then, it reads solver parameter from input and restart which may override default values. When assertion checking is active, an unrecoverable exception will result if the name string is empty or the pointer to the user-defined SNES functions object is null. |
|
Destructor for solve_SNES_SAMRAIContext destroys the SNES and the PETSc solution vector wrapper. |
|
Return the PETSc nonlinear solver object. |
|
Return pointer to object providing user-defined functions for SNES. |
|
Return the PETSc linear solver object. |
|
Return the PETSc Krylov solver object. |
|
Return the PETSc Mat object for the Jacobian. |
|
Get absolute tolerance for nonlinear solver. |
|
Set absolute tolerance for nonlinear solver. |
|
Get relative tolerance for nonlinear solver. |
|
Set relative tolerance for nonlinear solver. |
|
Get step tolerance for nonlinear solver. |
|
Set step tolerance for nonlinear solver. |
|
Get maximum iterations for nonlinear solver. |
|
Set maximum iterations for nonlinear solver. |
|
Get maximum function evaluations by nonlinear solver. |
|
Set maximum function evaluations in nonlinear solver. |
|
Get strategy for forcing term. |
|
Set strategy for forcing term. |
|
Get value of constant forcing term. |
|
Set value of constant forcing term. |
|
Get value of initial forcing term. |
|
Set value of initial forcing term. |
|
Get value of maximum forcing term. |
|
Set value of maximum forcing term. |
|
Get value of exponent in Eisenstat-Walker Choice 2 forcing term. |
|
Set value of exponent in Eisenstat-Walker Choice 2 forcing term. |
|
Get value of exponent in Eisenstat-Walker Choice 2 safeguard. |
|
Set value of exponent in Eisenstat-Walker Choice 2 safeguard. |
|
Get value of factor used to scale Eisenstat-Walker Choice 2 forcing term. |
|
Set value of factor used to scale Eisenstat-Walker Choice 2 forcing term. |
|
Get value of threshold to disable safeguard in Eisenstat-Walker forcing terms. |
|
Set value of threshold to disable safeguard in Eisenstat-Walker forcing terms. |
|
Get type of linear solver. |
|
Set type of linear solver. |
|
Get whether a preconditioner is used. |
|
Set whether to use a preconditioner. |
|
Get absolute tolerance for linear solver. |
|
Set absolute tolerance for linear solver. |
|
Get divergence tolerance for linear solver. |
|
Set divergence tolerance for linear solver. |
|
Get maximum linear iterations for linear solver. |
|
Set maximum linear iterations for linear solver. |
|
Get maximum Krylov dimension in GMRES linear solver. |
|
Set maximum Krylov dimension in GMRES linear solver. |
|
Get orthogonalization method used in GMRES linear solver. |
|
Set orthogonalization method used in GMRES linear solver. |
|
Get whether a method for explicit Jacobian-vector products is provided. |
|
Set whether a method for explicit Jacobian-vector products is provided. |
|
Get method for computing differencing parameter. |
|
Set method for computing differencing parameter. |
|
Get estimate of error in function evaluation. |
|
Set estimate of error in function evaluation. |
|
Initialize the state of the SNES solver based on vector argument representing the solution of the nonlinear system. In general, this routine must be called before the solve() routine is invoked. Implements SAMRAI::solv::NonlinearSolverStrategy< DIM >. |
|
Reset the state of the nonlinear solver after regridding. |
|
Solve the nonlinear problem. In general, the initialize() routine must be called before this solve function to set up the solver. Returns 1 if successful, 0 otherwise. Implements SAMRAI::solv::NonlinearSolverStrategy< DIM >. |
|
Obtain number of nonlinear iterations. |
|
Obtain total number of linear iterations accumulated over all nonlinear iterations. |
|
Report reason for termination. |
|
Write solver parameters to restart database matching object name. When assertion checking is active, an unrecoverable exception will result if database pointer is null. |
|
Print out all members of integrator instance to given output stream. |