OGS
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 310 of file CVodeSolver.cpp.

312  : _impl{new CVodeSolverImpl{config, num_equations}}
313 {
314 }

◆ ~CVodeSolver()

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

Member Function Documentation

◆ getSolution()

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

Definition at line 346 of file CVodeSolver.cpp.

347 {
348  return _impl->getSolution();
349 }

References _impl.

◆ getTime()

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

Definition at line 357 of file CVodeSolver.cpp.

358 {
359  return _impl->getTime();
360 }

References _impl.

◆ getYDot()

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

Definition at line 351 of file CVodeSolver.cpp.

353 {
354  _impl->getYDot(t, y, y_dot);
355 }

References _impl.

◆ preSolve()

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

Definition at line 336 of file CVodeSolver.cpp.

337 {
338  _impl->preSolve();
339 }

References _impl.

◆ setFunction()

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

Definition at line 326 of file CVodeSolver.cpp.

327 {
328  _impl->setFunction(std::move(f));
329 }

References _impl.

◆ setIC()

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

Definition at line 331 of file CVodeSolver.cpp.

332 {
333  _impl->setIC(t0, y0);
334 }

References _impl.

◆ setTolerance() [1/2]

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

Definition at line 321 of file CVodeSolver.cpp.

322 {
323  _impl->setTolerance(abstol, reltol);
324 }

References _impl.

◆ setTolerance() [2/2]

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

Definition at line 316 of file CVodeSolver.cpp.

317 {
318  _impl->setTolerance(abstol, reltol);
319 }

References _impl.

◆ solve()

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

Definition at line 341 of file CVodeSolver.cpp.

342 {
343  return _impl->solve(t_end);
344 }

References _impl.

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:
MathLib::ODE::CVodeSolver::_impl
std::unique_ptr< CVodeSolverImpl > _impl
pimpl idiom.
Definition: CVodeSolver.h:73