35template <
typename Derived, concepts::formula Formula>
65 this->
logger().set_iterative();
97 iter_logger.write_iteration(&
derived());
98 while (
time() < end_time) {
101 const bool rewrite_step_size = current_step_size > max_step_size;
102 if (rewrite_step_size) {
106 if (rewrite_step_size && (
step_size() >= max_step_size)) {
109 iter_logger.write_iteration(&
derived());
111 iter_logger.write_summary(&
derived());
185 return derived().step_size(val);
194 [[nodiscard]]
auto derived() noexcept -> Derived& {
195 return *
static_cast<Derived*
>(
this);
203 [[nodiscard]]
auto derived() const noexcept -> const Derived& {
204 return *
static_cast<const Derived*
>(
this);
Class to incorporate num_collect::logging::iterations::iteration_logger in algorithms.
auto initialize_iteration_logger() -> num_collect::logging::iterations::iteration_logger< Derived > &
Get the iteration logger.
Class to incorporate logging in algorithms.
void configure_child_algorithm_logger_if_exists(Child &child)
Configure a logger of a child algorithm if exists.
logging_mixin(log_tag_view tag)
Constructor.
auto logger() const noexcept -> const num_collect::logging::logger &
Access to the logger.
Base class of solvers of ODEs.
auto steps() const -> index_type
Get the number of steps.
auto problem() const -> const problem_type &
Get the problem.
Formula formula_type
Type of formula.
typename formula_type::problem_type problem_type
Type of problem.
auto formula() const -> const formula_type &
Get the formula.
typename problem_type::variable_type variable_type
Type of variables.
void solve_till(scalar_type end_time)
Compute the variable at the given time.
static constexpr index_type stages
Number of stages of the formula.
auto problem() -> problem_type &
Get the problem.
static constexpr index_type order
Order of the formula.
void init(scalar_type time, const variable_type &variable)
Initialize.
auto variable() const -> const variable_type &
Get the current variable.
auto step_size() const -> scalar_type
Get the step size.
auto step_size(scalar_type val) -> Derived &
Set the step size.
solver_base(const problem_type &problem)
Constructor.
auto derived() noexcept -> Derived &
Access derived object.
auto derived() const noexcept -> const Derived &
Access derived object.
void step()
Compute the variable of the next step.
typename problem_type::scalar_type scalar_type
Type of scalars.
auto formula() -> formula_type &
Get the formula.
formula_type formula_
Formula.
auto time() const -> scalar_type
Get the current time.
Definition of index_type type.
Definition of iteration_logger_mixin class.
Definition of logging_mixin class.
std::ptrdiff_t index_type
Type of indices in this library.
Namespace of solvers of ordinary differential equations (ODE).