Medusa  1.1
Coordinate Free Mehless Method implementation
mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t > Class Template Reference

#include <AdamsBashforth_fwd.hpp>

Detailed Description

template<typename Scalar, int num_steps>
template<typename func_t, typename initial_method_t = RKExplicit<Scalar, num_steps>>
class mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >

Integrator class for AB methods.

Template Parameters
starting_method_tTypes of the underlying starting method, required to get first num_steps values.
Warning
You should choose a method that provides same order of accuracy, is a single step method and has a fixed time step. A default choice is the num_steps stage Runge Kutta method, which might not always be correct. Predefined methods that are called by name, such as ExplicitMultistep::AB5(), have correct initial methods.

Definition at line 60 of file AdamsBashforth_fwd.hpp.

+ Collaboration diagram for mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >:

Public Member Functions

 Integrator (const AdamsBashforth< scalar_t, num_steps > &method, const initial_method_t &initial_method, const func_t &func, scalar_t t0, scalar_t t_max, scalar_t dt, Eigen::VectorXd y0)
 Constructs stepper with given initial method. More...
 
iterator begin ()
 Creates stepper at positioned at initial value. More...
 
const_iterator cbegin ()
 Same as Integrator::begin(). More...
 
iterator end ()
 Creates an invalid stepper at positioned past the last step, meant to be used for comparison it == end() only. More...
 
const_iterator cend ()
 Same as Integrator::end(). More...
 

Public Types

typedef IterationStep iterator
 iterator type More...
 
typedef IterationStep const_iterator
 const iterator type More...
 

Classes

class  IterationStep
 Class representing a step in the integration process. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const Integrator &integrator)
 Output information about this integrator. More...
 

Private Attributes

const initial_method_t initial_method_
 method used for first num_steps steps More...
 
const AdamsBashforth< scalar_t, num_steps > method_
 method used for all next steps More...
 
scalar_t t0_
 start time More...
 
scalar_t dt_
 time step More...
 
int max_steps
 number of steps More...
 
Eigen::VectorXd y0_
 initial value More...
 
const func_t & func_
 function to integrate More...
 

Constructor & Destructor Documentation

◆ Integrator()

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::Integrator ( const AdamsBashforth< scalar_t, num_steps > &  method,
const initial_method_t &  initial_method,
const func_t &  func,
scalar_t  t0,
scalar_t  t_max,
scalar_t  dt,
Eigen::VectorXd  y0 
)
inline

Constructs stepper with given initial method.

It is recommended to use the AdamsBashforth::solve() factory method to construct this object.

Definition at line 74 of file AdamsBashforth_fwd.hpp.

Member Function Documentation

◆ begin()

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
iterator mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::begin ( )
inline

Creates stepper at positioned at initial value.

Definition at line 171 of file AdamsBashforth_fwd.hpp.

◆ cbegin()

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
const_iterator mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::cbegin ( )
inline

Same as Integrator::begin().

Definition at line 174 of file AdamsBashforth_fwd.hpp.

◆ cend()

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
const_iterator mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::cend ( )
inline

Same as Integrator::end().

Definition at line 181 of file AdamsBashforth_fwd.hpp.

◆ end()

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
iterator mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::end ( )
inline

Creates an invalid stepper at positioned past the last step, meant to be used for comparison it == end() only.

Definition at line 178 of file AdamsBashforth_fwd.hpp.

Friends And Related Function Documentation

◆ operator<<

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
std::ostream& operator<< ( std::ostream &  os,
const Integrator< func_t, initial_method_t > &  integrator 
)
friend

Output information about this integrator.

Definition at line 184 of file AdamsBashforth_fwd.hpp.

Member Data Documentation

◆ dt_

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
scalar_t mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::dt_
private

time step

Definition at line 64 of file AdamsBashforth_fwd.hpp.

◆ func_

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
const func_t& mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::func_
private

function to integrate

Definition at line 67 of file AdamsBashforth_fwd.hpp.

◆ initial_method_

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
const initial_method_t mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::initial_method_
private

method used for first num_steps steps

Definition at line 61 of file AdamsBashforth_fwd.hpp.

◆ max_steps

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
int mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::max_steps
private

number of steps

Definition at line 65 of file AdamsBashforth_fwd.hpp.

◆ method_

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
const AdamsBashforth<scalar_t, num_steps> mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::method_
private

method used for all next steps

Definition at line 62 of file AdamsBashforth_fwd.hpp.

◆ t0_

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
scalar_t mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::t0_
private

start time

Definition at line 63 of file AdamsBashforth_fwd.hpp.

◆ y0_

template<typename Scalar , int num_steps>
template<typename func_t , typename initial_method_t = RKExplicit<Scalar, num_steps>>
Eigen::VectorXd mm::AdamsBashforth< Scalar, num_steps >::Integrator< func_t, initial_method_t >::y0_
private

initial value

Definition at line 66 of file AdamsBashforth_fwd.hpp.


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