OGS
CVodeSolver.h
Go to the documentation of this file.
1
11#pragma once
12
13#include <memory>
14
15#include "ODESolverTypes.h"
16#include "FunctionHandles.h"
17
18namespace BaseLib
19{
20class ConfigTree;
21}
22
23namespace MathLib
24{
25namespace ODE
26{
29
30class CVodeSolverImpl;
31
46{
47protected:
50 CVodeSolver(BaseLib::ConfigTree const& config,
51 unsigned const num_equations);
52
53 void setTolerance(double const* const abstol, const double reltol);
54 void setTolerance(const double abstol, const double reltol);
55
56 void setFunction(std::unique_ptr<detail::FunctionHandles>&& f);
57
58 void setIC(const double t0, double const* const y0);
59
60 void preSolve();
61 bool solve(const double t_end);
62
63 double const* getSolution() const;
64 double getTime() const;
65 void getYDot(const double t,
66 double const* const y,
67 double* const y_dot) const;
68
70
71private:
73 std::unique_ptr<CVodeSolverImpl> impl_;
74};
75
77
78} // namespace ODE
79} // namespace MathLib
std::unique_ptr< CVodeSolverImpl > impl_
pimpl idiom.
Definition CVodeSolver.h:73
void setFunction(std::unique_ptr< detail::FunctionHandles > &&f)
bool solve(const double t_end)
void setTolerance(double const *const abstol, const double reltol)
void setIC(const double t0, double const *const y0)
void getYDot(const double t, double const *const y, double *const y_dot) const
double const * getSolution() const
CVodeSolver(BaseLib::ConfigTree const &config, unsigned const num_equations)
static const double t