#include <source/solvers/packages/petsc/SNESAbstractFunctions.h>
Public Member Functions | |
SNESAbstractFunctions () | |
virtual | ~SNESAbstractFunctions () |
virtual int | evaluateNonlinearFunction (Vec xcur, Vec fcur)=0 |
virtual int | evaluateJacobian (Vec x)=0 |
virtual int | jacobianTimesVector (Vec x, Vec y)=0 |
virtual int | setupPreconditioner (Vec xcur)=0 |
virtual int | applyPreconditioner (Vec r, Vec z)=0 |
Class SNESAbstractFunctions is an abstract base class that declares the functions to be used with the PETSc SNES nonlinear solver package. This class works in cooperation with the SNES_SAMRAIContext class. To provide these functions to the PETSc SNES solver package, a subclass of this base class must be instantiated and be supplied to the SNES_SAMRAIContext constructor. Pointers to these functions will be stored in a SNES context and invoked from within the nonlinear solver. Note that the virtual members of this class are all protected. They should not be used outside of a subclass of this class.
SAMRAI::solv::SNESAbstractFunctions::SNESAbstractFunctions | ( | ) |
Uninteresting constructor for SNESAbstractFunctions.
SAMRAI::solv::SNESAbstractFunctions::~SNESAbstractFunctions | ( | ) | [virtual] |
Uninteresting destructor for SNESAbstractFunctions.
virtual int SAMRAI::solv::SNESAbstractFunctions::evaluateNonlinearFunction | ( | Vec | xcur, | |
Vec | fcur | |||
) | [pure virtual] |
User-supplied nonlinear function evaluation. Returns 0 if successful. Arguments:
xcur | (IN) the current iterate for the nonlinear system | |
fcur | (OUT) current function value |
virtual int SAMRAI::solv::SNESAbstractFunctions::evaluateJacobian | ( | Vec | x | ) | [pure virtual] |
Optional user-supplied routine to evaluate the Jacobian of the system. This function can be empty if the matrix-free option has been selected. Returns 0 if successful. Arguments:
x | (IN) current Newton iterate. |
virtual int SAMRAI::solv::SNESAbstractFunctions::jacobianTimesVector | ( | Vec | x, | |
Vec | y | |||
) | [pure virtual] |
Optional user-supplied Jacobian-vector product routine. This function can be empty if the matrix-free option has been selected. Returns 0 if successful. Arguments:
x | (IN) vector to be multiplied by the Jacobian. | |
y | (OUT) the product of the Jacobian and vector |
virtual int SAMRAI::solv::SNESAbstractFunctions::setupPreconditioner | ( | Vec | xcur | ) | [pure virtual] |
User-supplied preconditioner setup function. The setup function is called to provide matrix data for the subsequent call(s) to applyPreconditioner(). The integer return value is a flag indicating success if 0 is returned, and failure otherwise. Together setupPreconditioner() and applyPreconditioner() form a right preconditoner for the PETSc Krylov solver. Returns 0 if successful.
virtual int SAMRAI::solv::SNESAbstractFunctions::applyPreconditioner | ( | Vec | r, | |
Vec | z | |||
) | [pure virtual] |
User-supplied preconditioner solve function. This function must solve , where is the right preconditioner matrix formed by setupPreconditioner(). The integer return value is a flag indicating success if 0 is returned, and failure otherwise. Arguments:
r | (IN) right-hand side of preconditioning system | |
z | (OUT) result of applying preconditioner to right-hand side |