numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
Loading...
Searching...
No Matches
num_collect::ode::simple_solver< Formula > Class Template Reference

Class of simple solver of ODEs. More...

#include <num_collect/ode/simple_solver.h>

+ Inheritance diagram for num_collect::ode::simple_solver< Formula >:
+ Collaboration diagram for num_collect::ode::simple_solver< Formula >:

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.
 

Detailed Description

template<concepts::formula Formula>
class num_collect::ode::simple_solver< Formula >

Class of simple solver of ODEs.

Template Parameters
FormulaType of formula.

Definition at line 39 of file simple_solver.h.

Member Typedef Documentation

◆ base_type

template<concepts::formula Formula>
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.

◆ this_type

template<concepts::formula Formula>
using num_collect::ode::simple_solver< Formula >::this_type = simple_solver<Formula>

This type.

Definition at line 42 of file simple_solver.h.

Member Function Documentation

◆ configure_iteration_logger()

template<concepts::formula Formula>
void num_collect::ode::simple_solver< Formula >::configure_iteration_logger ( logging::iterations::iteration_logger< this_type > & iteration_logger) const
inline

Configure an iteration logger.

Parameters
[in]iteration_loggerIteration logger.

Definition at line 72 of file simple_solver.h.

◆ init()

template<concepts::formula Formula>
void num_collect::ode::simple_solver< Formula >::init ( scalar_type time,
const variable_type & variable )
inline

Initialize.

Parameters
[in]timeInitial time.
[in]variableInitial variable.

Definition at line 57 of file simple_solver.h.

◆ step()

template<concepts::formula Formula>
void num_collect::ode::simple_solver< Formula >::step ( )
inline

Compute the variable of the next step.

Warning
init function is assumed to have been called before call to step function.

Definition at line 64 of file simple_solver.h.

◆ step_size() [1/2]

template<concepts::formula Formula>
auto num_collect::ode::simple_solver< Formula >::step_size ( ) const -> scalar_type
inlinenodiscard

Get the step size.

Returns
Step size.

Definition at line 92 of file simple_solver.h.

◆ step_size() [2/2]

template<concepts::formula Formula>
auto num_collect::ode::simple_solver< Formula >::step_size ( scalar_type val) -> this_type&
inline

Set the step size.

Parameters
[in]valValue.
Returns
This object.

Definition at line 98 of file simple_solver.h.

◆ steps()

template<concepts::formula Formula>
auto num_collect::ode::simple_solver< Formula >::steps ( ) const -> index_type
inlinenodiscard

Get the number of steps.

Returns
Number of steps.

Definition at line 95 of file simple_solver.h.

◆ time()

template<concepts::formula Formula>
auto num_collect::ode::simple_solver< Formula >::time ( ) const -> scalar_type
inlinenodiscard

Get the current time.

Returns
Current time.

Definition at line 84 of file simple_solver.h.

◆ variable()

template<concepts::formula Formula>
auto num_collect::ode::simple_solver< Formula >::variable ( ) const -> const variable_type&
inlinenodiscard

Get the current variable.

Returns
Current variable.

Definition at line 87 of file simple_solver.h.

Member Data Documentation

◆ default_step_size

template<concepts::formula Formula>
auto num_collect::ode::simple_solver< Formula >::default_step_size = static_cast<scalar_type>(1e-4)
staticconstexprprivate

Default step size.

Definition at line 113 of file simple_solver.h.

◆ prev_variable_

template<concepts::formula Formula>
variable_type num_collect::ode::simple_solver< Formula >::prev_variable_ {}
private

Previous variable.

Definition at line 110 of file simple_solver.h.

◆ step_size_

template<concepts::formula Formula>
scalar_type num_collect::ode::simple_solver< Formula >::step_size_ {default_step_size}
private

Step size.

Definition at line 116 of file simple_solver.h.

◆ steps_

template<concepts::formula Formula>
index_type num_collect::ode::simple_solver< Formula >::steps_ {}
private

Number of steps.

Definition at line 122 of file simple_solver.h.

◆ time_

template<concepts::formula Formula>
scalar_type num_collect::ode::simple_solver< Formula >::time_ {}
private

Time.

Definition at line 119 of file simple_solver.h.

◆ variable_

template<concepts::formula Formula>
variable_type num_collect::ode::simple_solver< Formula >::variable_ {}
private

Variable.

Definition at line 107 of file simple_solver.h.


The documentation for this class was generated from the following file: