27template <
unsigned NumEquations>
54template <
typename Implementation,
unsigned NumEquations>
56 private Implementation
62 Implementation::setFunction(
67 const double reltol)
override
69 Implementation::setTolerance(abstol.data(), reltol);
72 void setTolerance(
const double abstol,
const double reltol)
override
74 Implementation::setTolerance(abstol, reltol);
78 std::initializer_list<double>
const& y0)
override
80 assert(y0.size() == NumEquations);
81 Implementation::setIC(t0, y0.begin());
85 Eigen::Matrix<double, NumEquations, 1, Eigen::ColMajor>
const&
88 Implementation::setIC(t0, y0.data());
91 void preSolve()
override { Implementation::preSolve(); }
92 bool solve(
const double t)
override {
return Implementation::solve(
t); }
97 double getTime()
const override {
return Implementation::getTime(); }
98 Eigen::Matrix<double, NumEquations, 1, Eigen::ColMajor>
getYDot(
101 Eigen::Matrix<double, NumEquations, 1, Eigen::ColMajor> y_dot;
102 Implementation::getYDot(
t, y.data(), y_dot.data());
109 : Implementation{config, NumEquations}
113 friend std::unique_ptr<ODESolver<NumEquations>>
void setIC(const double t0, Eigen::Matrix< double, NumEquations, 1, Eigen::ColMajor > const &y0) override
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setIC(const double t0, std::initializer_list< double > const &y0) override
friend std::unique_ptr< ODESolver< NumEquations > > createODESolver(BaseLib::ConfigTree const &config)
double getTime() const override
void setFunction(Function< NumEquations > f, JacobianFunction< NumEquations > df) override
void setTolerance(const std::array< double, NumEquations > &abstol, const double reltol) override
bool solve(const double t) override
MappedConstVector< NumEquations > getSolution() const override
Returns the solution vector y.
ConcreteODESolver(BaseLib::ConfigTree const &config)
Instances of this class shall only be constructed by createODESolver().
Eigen::Matrix< double, NumEquations, 1, Eigen::ColMajor > getYDot(const double t, const MappedConstVector< NumEquations > &y) const override
void setTolerance(const double abstol, const double reltol) override
MappedConstMatrix< N, 1 > MappedConstVector
std::function< bool(const double t, MappedConstVector< N > const &y, MappedConstVector< N > const &ydot, MappedMatrix< N, N > &jac)> JacobianFunction
std::function< bool( const double t, MappedConstVector< N > const &y, MappedVector< N > &ydot)> Function
std::unique_ptr< ODESolver< NumEquations > > createODESolver(BaseLib::ConfigTree const &config)
Function handles for an ODE system of N equations.