Tatooine
domain_error_checker.h
Go to the documentation of this file.
1#ifndef TATOOINE_ODE_BOOST_DOMAIN_ERROR_CHECKER_H
2#define TATOOINE_ODE_BOOST_DOMAIN_ERROR_CHECKER_H
3//==============================================================================
4#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp>
5//==============================================================================
6namespace tatooine::ode::boost {
7//==============================================================================
8template <typename Value, typename Algebra, typename Operations>
11 Operations> {
12 public:
15 Operations>;
18 //============================================================================
19 domain_error_checker(value_type eps_abs = static_cast<value_type>(1.0e-10),
20 value_type eps_rel = static_cast<value_type>(1.0e-6),
21 value_type a_x = static_cast<value_type>(1),
22 value_type a_dxdt = static_cast<value_type>(1))
23 : parent_type{eps_abs, eps_rel, a_x, a_dxdt} {}
24 //============================================================================
25 auto error(algebra_type &algebra, auto const &x_old, auto const &dxdt_old,
26 auto &x_err, auto dt) const -> value_type {
27 if (std::isnan(x_err(0))) {
28 return 2;
29 }
30 return parent_type::error(algebra, x_old, dxdt_old, x_err, dt);
31 }
32};
33//==============================================================================
34} // namespace tatooine::ode::boost
35//==============================================================================
36#endif
value_type error(const State &x_old, const Deriv &dxdt_old, Err &x_err, Time dt) const
Definition: controller_runge_kutta_with_domain_check.h:36
Algebra algebra_type
Definition: controller_runge_kutta_with_domain_check.h:26
Definition: domain_error_checker.h:11
auto error(algebra_type &algebra, auto const &x_old, auto const &dxdt_old, auto &x_err, auto dt) const -> value_type
Definition: domain_error_checker.h:25
typename parent_type::algebra_type algebra_type
Definition: domain_error_checker.h:17
typename parent_type::value_type value_type
Definition: domain_error_checker.h:16
domain_error_checker(value_type eps_abs=static_cast< value_type >(1.0e-10), value_type eps_rel=static_cast< value_type >(1.0e-6), value_type a_x=static_cast< value_type >(1), value_type a_dxdt=static_cast< value_type >(1))
Definition: domain_error_checker.h:19
Definition: controller_runge_kutta_with_domain_check.h:19
Definition: utility.h:13