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< CVodeSolverImplimpl_
 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 312 of file CVodeSolver.cpp.

314  : impl_{new CVodeSolverImpl{config, num_equations}}
315 {
316 }
std::unique_ptr< CVodeSolverImpl > impl_
pimpl idiom.
Definition: CVodeSolver.h:73

◆ ~CVodeSolver()

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

Member Function Documentation

◆ getSolution()

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

Definition at line 348 of file CVodeSolver.cpp.

349 {
350  return impl_->getSolution();
351 }

References impl_.

◆ getTime()

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

Definition at line 359 of file CVodeSolver.cpp.

360 {
361  return impl_->getTime();
362 }

References impl_.

◆ getYDot()

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

Definition at line 353 of file CVodeSolver.cpp.

355 {
356  impl_->getYDot(t, y, y_dot);
357 }
static const double t

References impl_, and MathLib::t.

◆ preSolve()

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

Definition at line 338 of file CVodeSolver.cpp.

339 {
340  impl_->preSolve();
341 }

References impl_.

◆ setFunction()

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

Definition at line 328 of file CVodeSolver.cpp.

329 {
330  impl_->setFunction(std::move(f));
331 }

References impl_.

◆ setIC()

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

Definition at line 333 of file CVodeSolver.cpp.

334 {
335  impl_->setIC(t0, y0);
336 }

References impl_.

◆ setTolerance() [1/2]

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

Definition at line 323 of file CVodeSolver.cpp.

324 {
325  impl_->setTolerance(abstol, reltol);
326 }

References impl_.

◆ setTolerance() [2/2]

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

Definition at line 318 of file CVodeSolver.cpp.

319 {
320  impl_->setTolerance(abstol, reltol);
321 }

References impl_.

◆ solve()

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

Definition at line 343 of file CVodeSolver.cpp.

344 {
345  return impl_->solve(t_end);
346 }

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: