numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
|
Class of simple solver of ODEs. More...
#include <num_collect/ode/simple_solver.h>
Public Types | |
using | base_type = solver_base<simple_solver<Formula>, Formula> |
Type of base class. | |
using | this_type = simple_solver<Formula> |
This type. | |
Public Types inherited from num_collect::ode::solver_base< simple_solver< Formula >, Formula > | |
using | formula_type |
Type of formula. | |
using | problem_type |
Type of problem. | |
using | scalar_type |
Type of scalars. | |
using | 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. | |
void | init (scalar_type time, const variable_type &variable) |
Initialize. | |
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 | 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. | |
Public Member Functions inherited from num_collect::ode::solver_base< simple_solver< Formula >, Formula > | |
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) -> simple_solver< Formula > & |
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. | |
Public Member Functions inherited from num_collect::logging::logging_mixin | |
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. | |
Public Member Functions inherited from num_collect::logging::iterations::iteration_logger_mixin< simple_solver< Formula > > | |
iteration_logger_mixin ()=default | |
Constructor. | |
void | configure_iteration_logger (num_collect::logging::iterations::iteration_logger< simple_solver< Formula > > &iteration_logger) const |
Configure an iteration logger. | |
auto | initialize_iteration_logger () -> num_collect::logging::iterations::iteration_logger< simple_solver< Formula > > & |
Get the iteration logger. | |
Private Attributes | |
variable_type | prev_variable_ {} |
Previous variable. | |
scalar_type | step_size_ {default_step_size} |
Step size. | |
index_type | steps_ {} |
Number of steps. | |
scalar_type | time_ {} |
Time. | |
variable_type | variable_ {} |
Variable. | |
Static Private Attributes | |
static constexpr auto | default_step_size = static_cast<scalar_type>(1e-4) |
Default step size. | |
Additional Inherited Members | |
Static Public Attributes inherited from num_collect::ode::solver_base< simple_solver< Formula >, Formula > | |
static constexpr index_type | order |
Order of the formula. | |
static constexpr index_type | stages |
Number of stages of the formula. | |
Protected Member Functions inherited from num_collect::ode::solver_base< simple_solver< Formula >, Formula > | |
auto | derived () const noexcept -> const simple_solver< Formula > & |
Access derived object. | |
auto | derived () noexcept -> simple_solver< Formula > & |
Access derived object. | |
Class of simple solver of ODEs.
Formula | Type of formula. |
Definition at line 39 of file simple_solver.h.
using num_collect::ode::simple_solver< Formula >::base_type = solver_base<simple_solver<Formula>, Formula> |
Type of base class.
Definition at line 45 of file simple_solver.h.
using num_collect::ode::simple_solver< Formula >::this_type = simple_solver<Formula> |
This type.
Definition at line 42 of file simple_solver.h.
|
inline |
Configure an iteration logger.
[in] | iteration_logger | Iteration logger. |
Definition at line 72 of file simple_solver.h.
|
inline |
Initialize.
[in] | time | Initial time. |
[in] | variable | Initial variable. |
Definition at line 57 of file simple_solver.h.
|
inline |
Compute the variable of the next step.
init
function is assumed to have been called before call to step
function. Definition at line 64 of file simple_solver.h.
|
inlinenodiscard |
|
inline |
Set the step size.
[in] | val | Value. |
Definition at line 98 of file simple_solver.h.
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
staticconstexprprivate |
Default step size.
Definition at line 113 of file simple_solver.h.
|
private |
Previous variable.
Definition at line 110 of file simple_solver.h.
|
private |
Step size.
Definition at line 116 of file simple_solver.h.
|
private |
Number of steps.
Definition at line 122 of file simple_solver.h.
|
private |
Time.
Definition at line 119 of file simple_solver.h.
|
private |
Variable.
Definition at line 107 of file simple_solver.h.