#include <source/solvers/packages/sundials/kinsol/KINSOLAbstractFunctions.h>
Public Member Functions | |
KINSOLAbstractFunctions () | |
virtual | ~KINSOLAbstractFunctions () |
virtual void | evaluateNonlinearFunction (SundialsAbstractVector *soln, SundialsAbstractVector *fval)=0 |
virtual int | precondSetup (SundialsAbstractVector *soln, SundialsAbstractVector *soln_scale, SundialsAbstractVector *fval, SundialsAbstractVector *fval_scale, SundialsAbstractVector *vtemp1, SundialsAbstractVector *vtemp2, int &num_feval)=0 |
virtual int | precondSolve (SundialsAbstractVector *soln, SundialsAbstractVector *soln_scale, SundialsAbstractVector *fval, SundialsAbstractVector *fval_scale, SundialsAbstractVector *rhs, SundialsAbstractVector *vtemp, int &num_feval)=0 |
virtual int | jacobianTimesVector (SundialsAbstractVector *vector, SundialsAbstractVector *product, const bool soln_changed, SundialsAbstractVector *soln)=0 |
KINSOL only requires that the function evaluateNonlinearFunction() be supplied. The other virtual functions are optional in KINSOL. Note that the use of the optional functions may be turned on and off via boolean arguments to the constructor of the KINSOLSolver class, or using the setKINSOLFunctions() member function of that class.
SAMRAI::solv::KINSOLAbstractFunctions::KINSOLAbstractFunctions | ( | ) |
Uninteresting constructor destructor for KINSOLAbstractFunctions.
SAMRAI::solv::KINSOLAbstractFunctions::~KINSOLAbstractFunctions | ( | ) | [virtual] |
virtual void SAMRAI::solv::KINSOLAbstractFunctions::evaluateNonlinearFunction | ( | SundialsAbstractVector * | soln, | |
SundialsAbstractVector * | fval | |||
) | [pure virtual] |
User-supplied nonlinear residual function evaluation.
The function arguments are:
IMPORTANT: This function must not modify the vector soln.
virtual int SAMRAI::solv::KINSOLAbstractFunctions::precondSetup | ( | SundialsAbstractVector * | soln, | |
SundialsAbstractVector * | soln_scale, | |||
SundialsAbstractVector * | fval, | |||
SundialsAbstractVector * | fval_scale, | |||
SundialsAbstractVector * | vtemp1, | |||
SundialsAbstractVector * | vtemp2, | |||
int & | num_feval | |||
) | [pure virtual] |
User-supplied preconditioner setup function. The setup function is called to provide matrix data for the subsequent call(s) to precondSolve(). That is, this preconditioner setup function is used to evaluate and preprocess any Jacobian-related data needed by the preconditioner solve function. The integer return value is a flag indicating success if 0 is returned, and failure otherwise. If a non-zero value is returned, KINSOL stops. Together precondSetup() and precondSolve() form a right preconditoner for the KINSOL Krylov solver. This function will not be called prior to every call of precondSolve(), but instead will be called only as often as needed to achieve convergence within the Newton iteration.
The function arguments are:
The scaling vectors are provided for possible use in approximating Jacobian data; e.g., uing difference quotients. The
IMPORTANT: This function must not modify the vector arguments.
virtual int SAMRAI::solv::KINSOLAbstractFunctions::precondSolve | ( | SundialsAbstractVector * | soln, | |
SundialsAbstractVector * | soln_scale, | |||
SundialsAbstractVector * | fval, | |||
SundialsAbstractVector * | fval_scale, | |||
SundialsAbstractVector * | rhs, | |||
SundialsAbstractVector * | vtemp, | |||
int & | num_feval | |||
) | [pure virtual] |
User-supplied preconditioner solve function. This function must solve , where is the right preconditioner matrix formed by precondSetup(). The integer return value is a flag indicating success if 0 is returned, and failure otherwise. If a non-zero value is returned, KINSOL stops.
The function arguments are:
IMPORTANT: This function must not modify soln, fval, or the scaling vectors.
virtual int SAMRAI::solv::KINSOLAbstractFunctions::jacobianTimesVector | ( | SundialsAbstractVector * | vector, | |
SundialsAbstractVector * | product, | |||
const bool | soln_changed, | |||
SundialsAbstractVector * | soln | |||
) | [pure virtual] |
Optional user-supplied A times x routine, where A is an approximation to the Jacobian matrix and v is some vector. product = (A * vector) is computed.
The function arguments are:
IMPORTANT: This function must not modify soln vector.