OGS 6.2.0-405-gb717f6088
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 44 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 306 of file CVodeSolver.cpp.

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

◆ ~CVodeSolver()

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

Referenced by getTime().

Member Function Documentation

◆ getSolution()

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

Definition at line 342 of file CVodeSolver.cpp.

References _impl.

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

◆ getTime()

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

Definition at line 353 of file CVodeSolver.cpp.

References _impl, and ~CVodeSolver().

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

◆ getYDot()

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

Definition at line 347 of file CVodeSolver.cpp.

References _impl.

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

◆ preSolve()

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

Definition at line 332 of file CVodeSolver.cpp.

References _impl.

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

◆ setFunction()

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

Definition at line 322 of file CVodeSolver.cpp.

References _impl.

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

◆ setIC()

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

Definition at line 327 of file CVodeSolver.cpp.

References _impl.

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

◆ setTolerance() [1/2]

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

Definition at line 312 of file CVodeSolver.cpp.

References _impl.

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

◆ setTolerance() [2/2]

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

Definition at line 317 of file CVodeSolver.cpp.

References _impl.

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

◆ solve()

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

Definition at line 337 of file CVodeSolver.cpp.

References _impl.

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

Member Data Documentation

◆ _impl

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

pimpl idiom.

Definition at line 72 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: