OGS 6.2.1-710-gde5194452.dirty.20191209112531
MathLib::ODE::CVodeSolver Class Reference

Detailed Description

ODE solver interfacing with Sundials' CVode.

All methods of this class have the same semantics as methods from the ODESolver interface with the same name.

There is no implicit information about vector and matrix sizes in this class anymore, rather this class only handles raw pointers. But this is exactly what is necessary when using C libraries like Sundials.

Note
This class is for internal use only. Therefore all members of this class are protected, namely because ConcreteODESolver derives from this class.

Definition at line 45 of file CVodeSolver.h.

#include <CVodeSolver.h>

Protected Member Functions

 CVodeSolver (BaseLib::ConfigTree const &config, unsigned const num_equations)
 
void setTolerance (double const *const abstol, const double reltol)
 
void setTolerance (const double abstol, const double reltol)
 
void setFunction (std::unique_ptr< detail::FunctionHandles > &&f)
 
void setIC (const double t0, double const *const y0)
 
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) const
 
 ~CVodeSolver ()
 

Private Attributes

std::unique_ptr< CVodeSolverImpl_impl
 pimpl idiom. More...
 

Constructor & Destructor Documentation

◆ CVodeSolver()

MathLib::ODE::CVodeSolver::CVodeSolver ( BaseLib::ConfigTree const &  config,
unsigned const  num_equations 
)
protected

Construct from the given config with storage allocated for the given num_equations.

Definition at line 307 of file CVodeSolver.cpp.

309  : _impl{new CVodeSolverImpl{config, num_equations}}
310 {
311 }
std::unique_ptr< CVodeSolverImpl > _impl
pimpl idiom.
Definition: CVodeSolver.h:73

◆ ~CVodeSolver()

MathLib::ODE::CVodeSolver::~CVodeSolver ( )
protecteddefault

Referenced by getTime().

Member Function Documentation

◆ getSolution()

double const * MathLib::ODE::CVodeSolver::getSolution ( ) const
protected

Definition at line 343 of file CVodeSolver.cpp.

References _impl.

344 {
345  return _impl->getSolution();
346 }
std::unique_ptr< CVodeSolverImpl > _impl
pimpl idiom.
Definition: CVodeSolver.h:73

◆ getTime()

double MathLib::ODE::CVodeSolver::getTime ( ) const
protected

Definition at line 354 of file CVodeSolver.cpp.

References _impl, and ~CVodeSolver().

355 {
356  return _impl->getTime();
357 }
std::unique_ptr< CVodeSolverImpl > _impl
pimpl idiom.
Definition: CVodeSolver.h:73

◆ getYDot()

void MathLib::ODE::CVodeSolver::getYDot ( const double  t,
double const *const  y,
double *const  y_dot 
) const
protected

Definition at line 348 of file CVodeSolver.cpp.

References _impl.

350 {
351  _impl->getYDot(t, y, y_dot);
352 }
std::unique_ptr< CVodeSolverImpl > _impl
pimpl idiom.
Definition: CVodeSolver.h:73

◆ preSolve()

void MathLib::ODE::CVodeSolver::preSolve ( )
protected

Definition at line 333 of file CVodeSolver.cpp.

References _impl.

334 {
335  _impl->preSolve();
336 }
std::unique_ptr< CVodeSolverImpl > _impl
pimpl idiom.
Definition: CVodeSolver.h:73

◆ setFunction()

void MathLib::ODE::CVodeSolver::setFunction ( std::unique_ptr< detail::FunctionHandles > &&  f)
protected

Definition at line 323 of file CVodeSolver.cpp.

References _impl.

324 {
325  _impl->setFunction(std::move(f));
326 }
std::unique_ptr< CVodeSolverImpl > _impl
pimpl idiom.
Definition: CVodeSolver.h:73

◆ setIC()

void MathLib::ODE::CVodeSolver::setIC ( const double  t0,
double const *const  y0 
)
protected

Definition at line 328 of file CVodeSolver.cpp.

References _impl.

329 {
330  _impl->setIC(t0, y0);
331 }
std::unique_ptr< CVodeSolverImpl > _impl
pimpl idiom.
Definition: CVodeSolver.h:73

◆ setTolerance() [1/2]

void MathLib::ODE::CVodeSolver::setTolerance ( double const *const  abstol,
const double  reltol 
)
protected

Definition at line 313 of file CVodeSolver.cpp.

References _impl.

314 {
315  _impl->setTolerance(abstol, reltol);
316 }
std::unique_ptr< CVodeSolverImpl > _impl
pimpl idiom.
Definition: CVodeSolver.h:73

◆ setTolerance() [2/2]

void MathLib::ODE::CVodeSolver::setTolerance ( const double  abstol,
const double  reltol 
)
protected

Definition at line 318 of file CVodeSolver.cpp.

References _impl.

319 {
320  _impl->setTolerance(abstol, reltol);
321 }
std::unique_ptr< CVodeSolverImpl > _impl
pimpl idiom.
Definition: CVodeSolver.h:73

◆ solve()

bool MathLib::ODE::CVodeSolver::solve ( const double  t_end)
protected

Definition at line 338 of file CVodeSolver.cpp.

References _impl.

339 {
340  return _impl->solve(t_end);
341 }
std::unique_ptr< CVodeSolverImpl > _impl
pimpl idiom.
Definition: CVodeSolver.h:73

Member Data Documentation

◆ _impl

std::unique_ptr<CVodeSolverImpl> MathLib::ODE::CVodeSolver::_impl
private

pimpl idiom.

Definition at line 73 of file CVodeSolver.h.

Referenced by getSolution(), getTime(), getYDot(), preSolve(), setFunction(), setIC(), setTolerance(), and solve().


The documentation for this class was generated from the following files: