...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Home | Libraries | People | FAQ | More |
boost::numeric::odeint::symplectic_rkn_sb3a_mclachlan — Implement of the symmetric B3A method of Runge-Kutta-Nystroem method of sixth order.
// In header: <boost/numeric/odeint/stepper/symplectic_rkn_sb3a_mclachlan.hpp> template<typename Coor, typename Momentum = Coor, typename Value = double, typename CoorDeriv = Coor, typename MomentumDeriv = Coor, typename Time = Value, typename Algebra = range_algebra, typename Operations = default_operations, typename Resizer = initially_resizer> class symplectic_rkn_sb3a_mclachlan : public boost::numeric::odeint::symplectic_nystroem_stepper_base< NumOfStages, Order, Coor, Momentum, Value, CoorDeriv, MomentumDeriv, Time, Algebra, Operations, Resizer > { public: // types typedef stepper_base_type::algebra_type algebra_type; typedef stepper_base_type::value_type value_type; // construct/copy/destruct symplectic_rkn_sb3a_mclachlan(const algebra_type & = algebra_type()); // public member functions order_type order(void) const; template<typename System, typename StateInOut> void do_step(System, const StateInOut &, time_type, time_type); template<typename System, typename StateInOut> void do_step(System, StateInOut &, time_type, time_type); template<typename System, typename CoorInOut, typename MomentumInOut> void do_step(System, CoorInOut &, MomentumInOut &, time_type, time_type); template<typename System, typename CoorInOut, typename MomentumInOut> void do_step(System, const CoorInOut &, const MomentumInOut &, time_type, time_type); template<typename System, typename StateIn, typename StateOut> void do_step(System, const StateIn &, time_type, StateOut &, time_type); template<typename StateType> void adjust_size(const StateType &); const coef_type & coef_a(void) const; const coef_type & coef_b(void) const; algebra_type & algebra(); const algebra_type & algebra() const; };
The method is of fourth order and has six stages. It is described HERE. This method cannot be used with multiprecision types since the coefficients are not defined analytically.
ToDo Add reference to the paper.
typename Coor
The type representing the coordinates q.
typename Momentum = Coor
The type representing the coordinates p.
typename Value = double
The basic value type. Should be something like float, double or a high-precision type.
typename CoorDeriv = Coor
The type representing the time derivative of the coordinate dq/dt.
typename MomentumDeriv = Coor
typename Time = Value
The type representing the time t.
typename Algebra = range_algebra
The algebra.
typename Operations = default_operations
The operations.
typename Resizer = initially_resizer
The resizer policy.
symplectic_rkn_sb3a_mclachlan
public
construct/copy/destructsymplectic_rkn_sb3a_mclachlan(const algebra_type & algebra = algebra_type());Constructs the
symplectic_rkn_sb3a_mclachlan
. This constructor can be used as a default constructor if the algebra has a default constructor.
Parameters: |
|
symplectic_rkn_sb3a_mclachlan
public member functionsorder_type order(void) const;
Returns: |
Returns the order of the stepper. |
template<typename System, typename StateInOut> void do_step(System system, const StateInOut & state, time_type t, time_type dt);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: |
|
template<typename System, typename StateInOut> void do_step(System system, StateInOut & state, time_type t, time_type dt);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<typename System, typename CoorInOut, typename MomentumInOut> void do_step(System system, CoorInOut & q, MomentumInOut & p, time_type t, time_type dt);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: |
|
template<typename System, typename CoorInOut, typename 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 ). It differs only in a different const specifier in order to solve the forwarding problem, can be called with Boost.Range.
template<typename System, typename StateIn, typename StateOut> void do_step(System system, const StateIn & in, time_type t, StateOut & out, time_type dt);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: |
|
template<typename StateType> void adjust_size(const StateType & x);Adjust the size of all temporaries in the stepper manually.
Parameters: |
|
const coef_type & coef_a(void) const;Returns the coefficients a.
const coef_type & coef_b(void) const;Returns the coefficients b.
algebra_type & algebra();
Returns: |
A reference to the algebra which is held by this class. |
const algebra_type & algebra() const;
Returns: |
A const reference to the algebra which is held by this class. |