#include <source/solvers/packages/pvode_trio/pvode/wrapper/PVODESolver.h>
It is intended to be sufficiently generic to be used independently of the SAMRAI framework. This class declares one private static member function to link the user-defined routine for right-hand side function evaluation and two private statice member functions to link the user-defined preconditioner setup and solve routines. The implementation of these functions is defined by the user in a subclass of the abstract base class PVODEAbstractFunctions. The vector objects used within the solver are given in a subclass of the abstract class PVodeTrioAbstractVector. The PVodeTrioAbstractVector class defines the vector kernel operations required by the PVODE package so that they may be easily supplied by a user who opts not to use the vector kernel supplied by the PVODE package. (It should be noted that the vector kernel used by PVODE is the same as the one used by the other packages in the PVodeTrio of solvers).
Note that this class provides no input or restart capabilities and relies on PVODE for output reporting.
PVODESolver Usage:
PVODE was developed in the Center for Applied Scientific Computing (CASC) at Lawrence Livermore National Laboratory (LLNL). Many of the comments in this class were taken verbatim from PVODE header files. For more information about PVODE and a complete description of the operations and data structures used by this class, see S.D. Cohen and A.C. Hindmarsh, "PVODE User Guide", UCRL-MA-118618, Lawrence Livermore National Laboratory, 1994.
|
Constructor for PVODESolver sets default PVODE parameters and initializes the solver package with user-supplied functions PVODESolver parameters may be changed later using member functions described below. Notes:
Assertion checks:
|
|
Virtual destructor for PVODESolver closes the PVODE log file and frees the memory allocated for the PVODE memory record. |
|
Initialize solver with solution vector. The solution vector is required to initialize the memory record used internally within PVODE. This routine must be called before the solver can be used. Assertion checks:
|
|
Integrate ODE system specified t_f. The integer return value is a termination code defined by PVODE. The following is a table of termination codes and a brief description of their meanings. PVODE Termination Codes:
See cvode.h header file for more information about return values. If PVODE or CVSpgmr requires re-initialization, it is automatically done before the solve. This may be required if any of the PVODE or CVSpgmr data parameters have changed since the last call to the solver. Assertion checks:
|
|
Accessor function for setting PVODE output log file name and output printing options. Output file name and options may be changed throughout run as desired. If the file name string is empty the default file name "cvode.log" is used. |
|
Set PVODESolver to use my_functions as the concrete subclass of the PVODEAbstractFunctions class that defines the right-hand side evaluation and preconditioner functions. The uses_preconditioner argument indicates whether or not the the user has defined preconditioner routines in their concrete subclass of the PVODEAbstractFunctions class. Assertion checks:
|
|
Return pointer to object that provides user-defined functions for PVODE and CVSpgmr. |
|
Set number of equations in system of ODEs to be solved. Assertion checks:
|
|
Set linear multistep method. The user can specify either ADAMS or BDF (backward differentiation formula) methods The BDF method is recommended for stiff problems, and the ADAMS method is recommended for nonstiff problems. Assertion checks:
Note: the enumeration constants ADAMS and BDF are defined in cvode.h. |
|
Set iteration type. The user can specify either FUNCTIONAL iteration, which does not require linear algebra, or a NEWTON iteration, which requires the solution of linear systems. In the NEWTON case, the user must also specify a PVODE linear solver. NEWTON is recommended in case of stiff problems. Assertion checks:
Note: the enumeration constants FUNCTIONAL and NEWTON are defined in cvode.h. |
|
Set tolerance type. This parameter specifies the relative and absolute tolerance types to be used. The SS tolerance type means a scalar relative and absolute tolerance, while the SV tolerance type means a scalar relative tolerance and a vector absolute tolerance (a potentially different absolute tolerance for each vector component). Assertion checks:
Note: the enumeration constants SS and SV are defined in cvode.h. |
|
Set the relative tolerance level. Assertion checks:
Note that pure absolute tolerance can be used by setting the relative tolerance to 0. However, it is an error to simultaneously set relative and absolute tolerances to 0. |
|
Set the scalar absolute tolerance level. Assertion checks:
Note that pure relative tolerance can be used by setting the absolute tolerance to 0. However, it is an error to simultaneously set relative and absolute tolerances to 0. |
|
Set the vector absolute tolerance level. Assertion checks:
Note that pure relative tolerance can be used by setting the absolute tolerance to 0. However, it is an error to simultaneously set relative and absolute tolerances to 0. |
|
Set stepping method to use for integration. There are stepping methods: NORMAL and ONE_STEP. The NORMAL method has the solver take internal steps until it has reached or just passed the user specified t_f parameter. The solver then interpolates in order to return an approximate value of y(t_f). The ONE_STEP option tells the solver to just take one internal step and return the solution at the point reached by that step. Assertion checks:
Note: the enumeration constants NORMAL and ONE_STEP are defined in cvode.h. |
|
Set initial value for independent variable. |
|
Set final value for independent variable (i.e. the value of independent variable to integrate the system to). The boolean argument specifies whether PVODE should be re-initialized (i.e. on first step) or if we are taking subsequent steps in a sequence, in which case it is not initialized. |
|
Set initial condition vector. Assertion checks:
|
|
Set maximum order for the linear multistep method. By default, this is set to 12 for ADAMS methods and 5 for BDF methods. Assertion checks:
|
|
Set maximum number of internal steps to be taken by the solver in its attempt to reach t_f. By default, this is set to 500. Assertion checks:
|
|
Set maximum number of warning messages issued by the solver that (t + h == t) on the next internal step. By default, this is set to 10. Assertion checks:
|
|
Set initial step size. Assertion checks:
|
|
Set maximum absolute value of step size allowed. By default, there is no upper bound on the absolute value of step size. Assertion checks:
|
|
Set minimum absolute value of step size allowed. By default, this is set to 0.0. Assertion checks:
|
|
Set the preconditioning type to be used by CVSpgmr. This must be one of the four enumeration constants NONE, LEFT, RIGHT, or BOTH defined in iterativ.h. These correspond to no preconditioning, left preconditioning only, right preconditioning only, and both left and right preconditioning, respectively. Assertion Checks:
|
|
Set the Gram-Schmidt orthogonalization type to be used by CVSpgmr. This must be one of the two enumeration constants MODIFIED_GS or CLASSICAL_GS defined in iterativ.h. These correspond to using modified Gram-Schmidt and classical Gram-Schmidt, respectively. Assertion Checks:
|
|
Set the maximum Krylov dimension to be used by CVSpgmr. This is an optional input to the CVSPGMR solver. Pass 0 to use the default value MIN(num_equations, CVSPGMR_MAXL=5). Assertion Checks:
|
|
Set the factor by which the tolerance on the nonlinear iteration is multiplied to get a tolerance on the linear iteration. This is an optional input to the CVSPGMR solver. Pass 0 to use the default value CVSPGMR_DELT = 0.05. Assertion Checks:
|
|
Get solution vector. |
|
Get k-th derivative vector at the specified value of the independent variable, t. The integer return value is return code the PVODE CVodeDky() function. The following is a table of termination codes and a brief description of their meanings. CVodeDky Return Codes:
Important Notes:
|
|
Get actual value of the independent variable that PVODE integrated to (i.e. the value of t that actually corresponds to the solution vector y). |
|
Set PVODE to collect statistics. This must be called before solve() is invoked. |
|
Print PVODE and CVSpgmr statistics. |
|
Print PVODE statistics to the stream. The abbreviations printed out refer to the following quantities:
|
|
Return the cumulative number of internal steps taken by the solver. Note: if the solver was not set to collect statistics, a value of -1 is returned. |
|
Return the number of calls to the right-hand side function. Note: if the solver was not set to collect statistics, a value of -1 is returned. |
|
Return the number of calls made to linear solver setup routines. Note: if the solver was not set to collect statistics, a value of -1 is returned. |
|
Return the number of NEWTON iterations performed. Note: if the solver was not set to collect statistics, a value of -1 is returned. |
|
Return the number of nonlinear convergence failures that have occurred. Note: if the solver was not set to collect statistics, a value of -1 is returned. |
|
Return the number of local error test failures. Note: if the solver was not set to collect statistics, a value of -1 is returned. |
|
Return the order of the linear multistep method used during the last internal step. Note: if the solver was not set to collect statistics, a value of -1 is returned. |
|
Return the order of the linear multistep method to be used during the next internal step. Note: if the solver was not set to collect statistics, a value of -1 is returned. |
|
Return the size (in LLNL_REAL words) of memory used for LLNL_REALS. Note: if the solver was not set to collect statistics, a value of -1 is returned. |
|
Return the size (in integer words) of memory used for integers. Note: if the solver was not set to collect statistics, a value of -1 is returned. |
|
Return the step size for the last internal step. Note: if the solver was not set to collect statistics, a value of -1 is returned. |
|
Return the step size to be used in the next internal step. Note: if the solver was not set to collect statistics, a value of -1 is returned. |
|
Return the current internal value of the independent variable reached by the solver. Note: if the solver was not set to collect statistics, the minimum double value (as defined in float.h) is returned. |
|
Return the suggested tolerance scaling factor. Note: if the solver was not set to collect statistics, a value of -1 is returned. |
|
Print CVSpgmr statistics to the stream. The abbreviations printed out refer to the following quantities:
|
|
Return the number of preconditioner evaluations. |
|
Return the number of linear iterations. |
|
Return the number of CVSpgmrPrecondSolve() calls. |
|
Return the number of linear convergence failures. |
|
Return the size (in double words) of memory used for doubles. |
|
Return the size (in integer words) of memory used for integers. |
|
Print out all data members for this object. |