Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer > Class Template Reference

Base class for all symplectic steppers of Nystroem type. More...

#include <symplectic_rkn_stepper_base.hpp>

Inheritance diagram for boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >:
Collaboration diagram for boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >:

Public Types

typedef algebra_stepper_base
< Algebra, Operations > 
algebra_stepper_base_type
 
typedef
algebra_stepper_base_type::algebra_type 
algebra_type
 
typedef
algebra_stepper_base_type::operations_type 
operations_type
 
typedef Coor coor_type
 
typedef Momentum momentum_type
 
typedef std::pair< coor_type,
momentum_type
state_type
 
typedef CoorDeriv coor_deriv_type
 
typedef state_wrapper
< coor_deriv_type
wrapped_coor_deriv_type
 
typedef MomentumDeriv momentum_deriv_type
 
typedef state_wrapper
< momentum_deriv_type
wrapped_momentum_deriv_type
 
typedef std::pair
< coor_deriv_type,
momentum_deriv_type
deriv_type
 
typedef Value value_type
 
typedef Time time_type
 
typedef Resizer resizer_type
 
typedef stepper_tag stepper_category
 
typedef
symplectic_nystroem_stepper_base
< NumOfStages, Order, Coor,
Momentum, Value, CoorDeriv,
MomentumDeriv, Time, Algebra,
Operations, Resizer > 
internal_stepper_base_type
 
typedef unsigned short order_type
 
typedef boost::array
< value_type, num_of_stages
coef_type
 

Public Member Functions

 symplectic_nystroem_stepper_base (const coef_type &coef_a, const coef_type &coef_b, const algebra_type &algebra=algebra_type())
 Constructs a symplectic_nystroem_stepper_base class. More...
 
order_type order (void) const
 
template<class System , class StateInOut >
void do_step (System system, const StateInOut &state, time_type t, time_type dt)
 This method performs one step. More...
 
template<class System , class StateInOut >
void do_step (System system, StateInOut &state, time_type t, time_type dt)
 Same function as above. More...
 
template<class System , class CoorInOut , class MomentumInOut >
void do_step (System system, CoorInOut &q, MomentumInOut &p, time_type t, time_type dt)
 This method performs one step. More...
 
template<class System , class CoorInOut , class MomentumInOut >
void do_step (System system, const CoorInOut &q, const MomentumInOut &p, time_type t, time_type dt)
 Same function as do_step( system , q , p , t , dt ). More...
 
template<class System , class StateIn , class StateOut >
void do_step (System system, const StateIn &in, time_type t, StateOut &out, time_type dt)
 This method performs one step. More...
 
template<class StateType >
void adjust_size (const StateType &x)
 Adjust the size of all temporaries in the stepper manually. More...
 
const coef_typecoef_a (void) const
 Returns the coefficients a. More...
 
const coef_typecoef_b (void) const
 Returns the coefficients b. More...
 
algebra_typealgebra ()
 
const algebra_typealgebra () const
 

Static Public Attributes

static const size_t num_of_stages = NumOfStages
 
static const order_type order_value = Order
 

Protected Attributes

algebra_type m_algebra
 

Detailed Description

template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
class boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >

Base class for all symplectic steppers of Nystroem type.

This class is the base class for the symplectic Runge-Kutta-Nystroem steppers. Symplectic steppers are usually used to solve Hamiltonian systems and they conserve the phase space volume, see en.wikipedia.org/wiki/Symplectic_integrator. Furthermore, the energy is conserved in average. In detail this class of steppers can be used to solve separable Hamiltonian systems which can be written in the form H(q,p) = H1(p) + H2(q). q is usually called the coordinate, while p is the momentum. The equations of motion are dq/dt = dH1/dp, dp/dt = -dH2/dq.

ToDo : add formula for solver and explanation of the coefficients

symplectic_nystroem_stepper_base uses odeints algebra and operation system. Step size and error estimation are not provided for this class of solvers. It derives from algebra_stepper_base. Several do_step variants are provided:

  • do_step( sys , x , t , dt ) - The classical do_step method. The sys can be either a pair of function objects for the coordinate or the momentum part or one function object for the momentum part. x is a pair of coordinate and momentum. The state is updated in-place.
  • do_step( sys , q , p , t , dt ) - This method is similar to the method above with the difference that the coordinate and the momentum are passed explicitly and not packed into a pair.
  • do_step( sys , x_in , t , x_out , dt ) - This method transforms the state out-of-place. x_in and x_out are here pairs of coordinate and momentum.
Template Parameters
NumOfStagesNumber of stages.
OrderThe order of the stepper.
CoorThe type representing the coordinates q.
MomentumThe type representing the coordinates p.
ValueThe basic value type. Should be something like float, double or a high-precision type.
CoorDerivThe type representing the time derivative of the coordinate dq/dt.
MomemtnumDerivThe type representing the time derivative of the momentum dp/dt.
TimeThe type representing the time t.
AlgebraThe algebra.
OperationsThe operations.
ResizerThe resizer policy.

Member Typedef Documentation

template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
typedef algebra_stepper_base< Algebra , Operations > boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::algebra_stepper_base_type
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
typedef algebra_stepper_base_type::algebra_type boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::algebra_type
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
typedef boost::array< value_type , num_of_stages > boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::coef_type
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
typedef CoorDeriv boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::coor_deriv_type
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
typedef Coor boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::coor_type
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
typedef std::pair< coor_deriv_type , momentum_deriv_type > boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::deriv_type
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
typedef symplectic_nystroem_stepper_base< NumOfStages , Order , Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer > boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::internal_stepper_base_type
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
typedef MomentumDeriv boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::momentum_deriv_type
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
typedef Momentum boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::momentum_type
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
typedef algebra_stepper_base_type::operations_type boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::operations_type
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
typedef unsigned short boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::order_type
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
typedef Resizer boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::resizer_type
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
typedef std::pair< coor_type , momentum_type > boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::state_type
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
typedef stepper_tag boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::stepper_category
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
typedef Time boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::time_type
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
typedef Value boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::value_type
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
typedef state_wrapper< coor_deriv_type> boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::wrapped_coor_deriv_type
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
typedef state_wrapper< momentum_deriv_type > boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::wrapped_momentum_deriv_type

Constructor & Destructor Documentation

template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::symplectic_nystroem_stepper_base ( const coef_type coef_a,
const coef_type coef_b,
const algebra_type algebra = algebra_type() 
)
inline

Constructs a symplectic_nystroem_stepper_base class.

The parameters of the specific Nystroem method and the algebra have to be passed.

Parameters
coef_aThe coefficients a.
coef_bThe coefficients b.
algebraA copy of algebra is made and stored inside explicit_stepper_base.

Member Function Documentation

template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
template<class StateType >
boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::adjust_size ( const StateType &  x)
inline

Adjust the size of all temporaries in the stepper manually.

Parameters
xA state from which the size of the temporaries to be resized is deduced.
template<class Algebra, class Operations>
algebra_type & boost::numeric::odeint::algebra_stepper_base< Algebra, Operations >::algebra ( )
inlineinherited
Returns
A reference to the algebra which is held by this class.
template<class Algebra, class Operations>
const algebra_type & boost::numeric::odeint::algebra_stepper_base< Algebra, Operations >::algebra ( ) const
inlineinherited
Returns
A const reference to the algebra which is held by this class.
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
const coef_type& boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::coef_a ( void  ) const
inline

Returns the coefficients a.

template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
const coef_type& boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::coef_b ( void  ) const
inline

Returns the coefficients b.

template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
template<class System , class StateInOut >
boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::do_step ( System  system,
const StateInOut &  state,
time_type  t,
time_type  dt 
)
inline

This method performs one step.

The system can be either a pair of two function object describing the momentum part and the coordinate part or one function object describing only the momentum part. In this case the coordinate is assumed to be trivial dq/dt = p. The state is updated in-place.

Note
boost::ref or std::ref can be used for the system as well as for the state. So, it is correct to write stepper.do_step( make_pair( std::ref( fq ) , std::ref( fp ) ) , make_pair( std::ref( q ) , std::ref( p ) ) , t , dt ).
This method solves the forwarding problem.
Parameters
systemThe system, can be represented as a pair of two function object or one function object. See above.
stateThe state of the ODE. It is a pair of Coor and Momentum. The state is updated in-place, therefore, the new value of the state will be written into this variable.
tThe time of the ODE. It is not advanced by this method.
dtThe time step.

Referenced by boost::numeric::odeint::symplectic_nystroem_stepper_base< 5, 4, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::do_step().

template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
template<class System , class StateInOut >
void boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::do_step ( System  system,
StateInOut &  state,
time_type  t,
time_type  dt 
)
inline

Same function as above.

It differs only in a different const specifier in order to solve the forwarding problem, can be used with Boost.Range.

template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
template<class System , class CoorInOut , class MomentumInOut >
boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::do_step ( System  system,
CoorInOut &  q,
MomentumInOut &  p,
time_type  t,
time_type  dt 
)
inline

This method performs one step.

The system can be either a pair of two function object describing the momentum part and the coordinate part or one function object describing only the momentum part. In this case the coordinate is assumed to be trivial dq/dt = p. The state is updated in-place.

Note
boost::ref or std::ref can be used for the system. So, it is correct to write stepper.do_step( make_pair( std::ref( fq ) , std::ref( fp ) ) , q , p , t , dt ).
This method solves the forwarding problem.
Parameters
systemThe system, can be represented as a pair of two function object or one function object. See above.
qThe coordinate of the ODE. It is updated in-place. Therefore, the new value of the coordinate will be written into this variable.
pThe momentum of the ODE. It is updated in-place. Therefore, the new value of the momentum will be written info this variable.
tThe time of the ODE. It is not advanced by this method.
dtThe time step.
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
template<class System , class CoorInOut , class MomentumInOut >
void boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::do_step ( System  system,
const CoorInOut &  q,
const MomentumInOut &  p,
time_type  t,
time_type  dt 
)
inline

Same function as do_step( system , q , p , t , dt ).

It differs only in a different const specifier in order to solve the forwarding problem, can be called with Boost.Range.

template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
template<class System , class StateIn , class StateOut >
boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::do_step ( System  system,
const StateIn &  in,
time_type  t,
StateOut &  out,
time_type  dt 
)
inline

This method performs one step.

The system can be either a pair of two function object describing the momentum part and the coordinate part or one function object describing only the momentum part. In this case the coordinate is assumed to be trivial dq/dt = p. The state is updated out-of-place.

Note
boost::ref or std::ref can be used for the system. So, it is correct to write stepper.do_step( make_pair( std::ref( fq ) , std::ref( fp ) ) , x_in , t , x_out , dt ).
This method NOT solve the forwarding problem.
Parameters
systemThe system, can be represented as a pair of two function object or one function object. See above.
inThe state of the ODE, which is a pair of coordinate and momentum. The state is updated out-of-place, therefore the new value is written into out
tThe time of the ODE. It is not advanced by this method.
outThe new state of the ODE.
dtThe time step.
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::order ( void  ) const
inline
Returns
Returns the order of the stepper.

Member Data Documentation

template<class Algebra, class Operations>
algebra_type boost::numeric::odeint::algebra_stepper_base< Algebra, Operations >::m_algebra
protectedinherited
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
const size_t boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::num_of_stages = NumOfStages
static
template<size_t NumOfStages, unsigned short Order, class Coor, class Momentum, class Value, class CoorDeriv, class MomentumDeriv, class Time, class Algebra, class Operations, class Resizer>
const order_type boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer >::order_value = Order
static

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