numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
|
Class of solvers of ODEs using embedded formulas. More...
#include <num_collect/ode/embedded_solver.h>
Public Types | |
using | base_type |
Type of base class. | |
using | formula_type |
Type of formula. | |
using | problem_type |
Type of problem. | |
using | scalar_type |
Type of scalars. | |
using | step_size_controller_type = StepSizeController |
Type of the controller of step sizes. | |
using | this_type = embedded_solver<Formula, StepSizeController> |
This type. | |
using | variable_type |
Type of variables. | |
![]() | |
using | formula_type = Formula |
Type of formula. | |
using | problem_type = typename formula_type::problem_type |
Type of problem. | |
using | scalar_type = typename problem_type::scalar_type |
Type of scalars. | |
using | variable_type = typename problem_type::variable_type |
Type of variables. | |
Public Member Functions | |
void | configure_iteration_logger (logging::iterations::iteration_logger< this_type > &iteration_logger) const |
Configure an iteration logger. | |
auto | error_norm () const -> scalar_type |
Get the estimate of error in the current variable. | |
auto | formula () -> formula_type & |
Get the formula. | |
auto | formula () const -> const formula_type & |
Get the formula. | |
void | init (scalar_type time, const variable_type &variable) |
Initialize. | |
auto | last_step_size () const -> scalar_type |
Get the step size used in the last step. | |
auto | problem () -> problem_type & |
Get the problem. | |
auto | problem () const -> const problem_type & |
Get the problem. | |
void | step () |
Compute the variable of the next step. | |
auto | step_size () const -> scalar_type |
Get the step size. | |
auto | step_size (scalar_type val) -> this_type & |
Set the step size. | |
auto | step_size_controller () -> step_size_controller_type & |
Access the controller of step sizes. | |
auto | step_size_controller () const -> const step_size_controller_type & |
Access the controller of step sizes. | |
auto | steps () const -> index_type |
Get the number of steps. | |
auto | time () const -> scalar_type |
Get the current time. | |
auto | tolerances (const error_tolerances< variable_type > &val) -> embedded_solver & |
Set the error tolerances. | |
auto | variable () const -> const variable_type & |
Get the current variable. | |
![]() | |
solver_base (const problem_type &problem) | |
Constructor. | |
auto | formula () -> formula_type & |
Get the formula. | |
auto | formula () const -> const formula_type & |
Get the formula. | |
void | init (scalar_type time, const variable_type &variable) |
Initialize. | |
auto | problem () -> problem_type & |
Get the problem. | |
auto | problem () const -> const problem_type & |
Get the problem. | |
void | solve_till (scalar_type end_time) |
Compute the variable at the given time. | |
void | step () |
Compute the variable of the next step. | |
auto | step_size () const -> scalar_type |
Get the step size. | |
auto | step_size (scalar_type val) -> Derived & |
Set the step size. | |
auto | steps () const -> index_type |
Get the number of steps. | |
auto | time () const -> scalar_type |
Get the current time. | |
auto | variable () const -> const variable_type & |
Get the current variable. | |
![]() | |
logging_mixin (log_tag_view tag) | |
Constructor. | |
template<typename Child> | |
void | configure_child_algorithm_logger_if_exists (Child &child) |
Configure a logger of a child algorithm if exists. | |
auto | logger () const noexcept -> const num_collect::logging::logger & |
Access to the logger. | |
auto | logger () noexcept -> num_collect::logging::logger & |
Access to the logger. | |
![]() | |
iteration_logger_mixin ()=default | |
Constructor. | |
void | configure_iteration_logger (num_collect::logging::iterations::iteration_logger< Derived > &iteration_logger) const |
Configure an iteration logger. | |
auto | initialize_iteration_logger () -> num_collect::logging::iterations::iteration_logger< Derived > & |
Get the iteration logger. | |
Static Public Attributes | |
static constexpr index_type | lesser_order = formula_type::lesser_order |
Order of lesser coefficients of this formula. | |
![]() | |
static constexpr index_type | order = formula_type::order |
Order of the formula. | |
static constexpr index_type | stages = formula_type::stages |
Number of stages of the formula. | |
Static Private Member Functions | |
static auto | norm (const variable_type &var) -> scalar_type |
Get the norm of a variable. | |
Private Attributes | |
variable_type | error_ {} |
Estimate of error. | |
scalar_type | last_step_size_ {std::numeric_limits<scalar_type>::quiet_NaN()} |
Step size used in the last step. | |
variable_type | prev_variable_ {} |
Previous variable. | |
std::optional< scalar_type > | step_size_ {} |
Step size used in the next step. | |
step_size_controller_type | step_size_controller_ {} |
Controller of step sizes. | |
index_type | steps_ {} |
Number of steps. | |
scalar_type | time_ {} |
Time. | |
variable_type | variable_ {} |
Variable. | |
Additional Inherited Members | |
![]() | |
auto | derived () const noexcept -> const Derived & |
Access derived object. | |
auto | derived () noexcept -> Derived & |
Access derived object. | |
Class of solvers of ODEs using embedded formulas.
Formula | Type of formula. |
StepSizeController | Type of the controller of step sizes. |
Definition at line 53 of file embedded_solver.h.
using num_collect::ode::embedded_solver< Formula, StepSizeController >::base_type |
Type of base class.
Definition at line 61 of file embedded_solver.h.
using num_collect::ode::solver_base< embedded_solver< Formula, StepSizeController >, Formula >::formula_type |
Type of formula.
Definition at line 41 of file solver_base.h.
using num_collect::ode::solver_base< embedded_solver< Formula, StepSizeController >, Formula >::problem_type |
Type of problem.
Definition at line 44 of file solver_base.h.
using num_collect::ode::solver_base< embedded_solver< Formula, StepSizeController >, Formula >::scalar_type |
Type of scalars.
Definition at line 50 of file solver_base.h.
using num_collect::ode::embedded_solver< Formula, StepSizeController >::step_size_controller_type = StepSizeController |
Type of the controller of step sizes.
Definition at line 70 of file embedded_solver.h.
using num_collect::ode::embedded_solver< Formula, StepSizeController >::this_type = embedded_solver<Formula, StepSizeController> |
This type.
Definition at line 58 of file embedded_solver.h.
using num_collect::ode::solver_base< embedded_solver< Formula, StepSizeController >, Formula >::variable_type |
Type of variables.
Definition at line 47 of file solver_base.h.
|
inline |
Configure an iteration logger.
[in] | iteration_logger | Iteration logger. |
Definition at line 131 of file embedded_solver.h.
|
inlinenodiscard |
Get the estimate of error in the current variable.
Definition at line 173 of file embedded_solver.h.
|
inlinenodiscard |
|
inlinenodiscard |
|
inline |
Initialize.
[in] | time | Initial time. |
[in] | variable | Initial variable. |
Definition at line 83 of file embedded_solver.h.
|
inlinenodiscard |
Get the step size used in the last step.
Definition at line 164 of file embedded_solver.h.
|
inlinestaticnodiscardprivate |
Get the norm of a variable.
[in] | var | Variable. |
Definition at line 232 of file embedded_solver.h.
|
inlinenodiscard |
|
inlinenodiscard |
|
inline |
Compute the variable of the next step.
init
function is assumed to have been called before call to step
function. Definition at line 106 of file embedded_solver.h.
|
inlinenodiscard |
|
inline |
Set the step size.
[in] | val | Value. |
Definition at line 181 of file embedded_solver.h.
|
inlinenodiscard |
Access the controller of step sizes.
Definition at line 193 of file embedded_solver.h.
|
inlinenodiscard |
Access the controller of step sizes.
Definition at line 202 of file embedded_solver.h.
|
inlinenodiscard |
|
inlinenodiscard |
|
inline |
Set the error tolerances.
[in] | val | Value. |
Definition at line 213 of file embedded_solver.h.
|
inlinenodiscard |
Get the current variable.
Definition at line 147 of file embedded_solver.h.
|
private |
Estimate of error.
Definition at line 254 of file embedded_solver.h.
|
private |
Step size used in the last step.
Definition at line 251 of file embedded_solver.h.
|
staticconstexpr |
Order of lesser coefficients of this formula.
Definition at line 76 of file embedded_solver.h.
|
private |
Previous variable.
Definition at line 242 of file embedded_solver.h.
|
private |
Step size used in the next step.
Definition at line 248 of file embedded_solver.h.
|
private |
Controller of step sizes.
Definition at line 257 of file embedded_solver.h.
|
private |
Number of steps.
Definition at line 263 of file embedded_solver.h.
|
private |
Time.
Definition at line 260 of file embedded_solver.h.
|
private |
Variable.
Definition at line 245 of file embedded_solver.h.