OGS
v6.4.0
|
This class provides concrete access to Sundials' CVode solver.
This class is the implementation part in the pimpl idiom used by the CVodeSolver class. Therefore all if this classes methods are only forwarded from CVodeSolver.
Definition at line 84 of file CVodeSolver.cpp.
Public Member Functions | |
CVodeSolverImpl (BaseLib::ConfigTree const &config, unsigned const num_equations) | |
void | setFunction (std::unique_ptr< detail::FunctionHandles > &&f) |
void | preSolve () |
bool | solve (const double t_end) |
double const * | getSolution () const |
double | getTime () const |
void | getYDot (const double t, double const *const y, double *const y_dot) |
void | setTolerance (const double *abstol, const double reltol) |
void | setTolerance (const double abstol, const double reltol) |
void | setIC (const double t0, double const *const y0) |
~CVodeSolverImpl () | |
Private Attributes | |
N_Vector | _y = nullptr |
The solution vector. More... | |
realtype | _t |
N_Vector | _abstol = nullptr |
current time More... | |
realtype | _reltol |
Relative tolerance. More... | |
unsigned | _num_equations |
Number of equations in the ODE system. More... | |
void * | _cvode_mem |
CVode's internal memory. More... | |
std::unique_ptr< detail::FunctionHandles > | _f |
int | _linear_multistep_method = CV_ADAMS |
The multistep method used for solving the ODE. More... | |
int | _nonlinear_solver_iteration = CV_FUNCTIONAL |
Either solve via fixed-point iteration or via Newton-Raphson method. More... | |
MathLib::ODE::CVodeSolverImpl::CVodeSolverImpl | ( | BaseLib::ConfigTree const & | config, |
unsigned const | num_equations | ||
) |
Definition at line 131 of file CVodeSolver.cpp.
References _abstol, _cvode_mem, _linear_multistep_method, _nonlinear_solver_iteration, _num_equations, _y, check_error(), DBUG(), BaseLib::ConfigTree::getConfigParameterOptional(), and OGS_FATAL.
MathLib::ODE::CVodeSolverImpl::~CVodeSolverImpl | ( | ) |
Definition at line 301 of file CVodeSolver.cpp.
References _abstol, _cvode_mem, _y, and printStats().
|
inline |
|
inline |
void MathLib::ODE::CVodeSolverImpl::getYDot | ( | const double | t, |
double const *const | y, | ||
double *const | y_dot | ||
) |
Definition at line 294 of file CVodeSolver.cpp.
References _f.
void MathLib::ODE::CVodeSolverImpl::preSolve | ( | ) |
Definition at line 236 of file CVodeSolver.cpp.
References _abstol, _cvode_mem, _f, _num_equations, _reltol, _t, _y, and check_error().
void MathLib::ODE::CVodeSolverImpl::setFunction | ( | std::unique_ptr< detail::FunctionHandles > && | f | ) |
Definition at line 220 of file CVodeSolver.cpp.
References _f, and _num_equations.
void MathLib::ODE::CVodeSolverImpl::setIC | ( | const double | t0, |
double const *const | y0 | ||
) |
void MathLib::ODE::CVodeSolverImpl::setTolerance | ( | const double * | abstol, |
const double | reltol | ||
) |
void MathLib::ODE::CVodeSolverImpl::setTolerance | ( | const double | abstol, |
const double | reltol | ||
) |
bool MathLib::ODE::CVodeSolverImpl::solve | ( | const double | t_end | ) |
|
private |
current time
Array of absolute tolerances.
Definition at line 112 of file CVodeSolver.cpp.
Referenced by CVodeSolverImpl(), preSolve(), setTolerance(), and ~CVodeSolverImpl().
|
private |
CVode's internal memory.
Definition at line 116 of file CVodeSolver.cpp.
Referenced by CVodeSolverImpl(), preSolve(), solve(), and ~CVodeSolverImpl().
|
private |
Function handles that compute \(\partial \dot y/\partial y\) and \(\dot y\).
Definition at line 120 of file CVodeSolver.cpp.
Referenced by getYDot(), preSolve(), and setFunction().
|
private |
The multistep method used for solving the ODE.
Definition at line 123 of file CVodeSolver.cpp.
Referenced by CVodeSolverImpl().
|
private |
Either solve via fixed-point iteration or via Newton-Raphson method.
Definition at line 126 of file CVodeSolver.cpp.
Referenced by CVodeSolverImpl().
|
private |
Number of equations in the ODE system.
Definition at line 115 of file CVodeSolver.cpp.
Referenced by CVodeSolverImpl(), preSolve(), setFunction(), setIC(), and setTolerance().
|
private |
Relative tolerance.
Definition at line 113 of file CVodeSolver.cpp.
Referenced by preSolve(), and setTolerance().
|
private |
Definition at line 110 of file CVodeSolver.cpp.
Referenced by getTime(), preSolve(), setIC(), and solve().
|
private |
The solution vector.
Definition at line 108 of file CVodeSolver.cpp.
Referenced by CVodeSolverImpl(), getSolution(), preSolve(), setIC(), solve(), and ~CVodeSolverImpl().