123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- #ifndef BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_RKN_SB3A_MCLACHLAN_HPP_INCLUDED
- #define BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_RKN_SB3A_MCLACHLAN_HPP_INCLUDED
- #include <boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp>
- #include <boost/numeric/odeint/algebra/range_algebra.hpp>
- #include <boost/numeric/odeint/algebra/default_operations.hpp>
- #include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
- #include <boost/numeric/odeint/algebra/operations_dispatcher.hpp>
- #include <boost/numeric/odeint/util/resizer.hpp>
- #include <boost/array.hpp>
- namespace boost {
- namespace numeric {
- namespace odeint {
- #ifndef DOXYGEN_SKIP
- namespace detail {
- namespace symplectic_rkn_sb3a_mclachlan {
-
- template< class Value >
- struct coef_a_type : public boost::array< Value , 6 >
- {
- coef_a_type( void )
- {
- (*this)[0] = static_cast< Value >( 0.40518861839525227722 );
- (*this)[1] = static_cast< Value >( -0.28714404081652408900 );
- (*this)[2] = static_cast< Value >( 1 ) / static_cast< Value >( 2 ) - ( (*this)[0] + (*this)[1] );
- (*this)[3] = (*this)[2];
- (*this)[4] = (*this)[1];
- (*this)[5] = (*this)[0];
- }
- };
- template< class Value >
- struct coef_b_type : public boost::array< Value , 6 >
- {
- coef_b_type( void )
- {
- (*this)[0] = static_cast< Value >( -3 ) / static_cast< Value >( 73 );
- (*this)[1] = static_cast< Value >( 17 ) / static_cast< Value >( 59 );
- (*this)[2] = static_cast< Value >( 1 ) - static_cast< Value >( 2 ) * ( (*this)[0] + (*this)[1] );
- (*this)[3] = (*this)[1];
- (*this)[4] = (*this)[0];
- (*this)[5] = static_cast< Value >( 0 );
- }
- };
- }
- }
- #endif
- template<
- class Coor ,
- class Momentum = Coor ,
- class Value = double ,
- class CoorDeriv = Coor ,
- class MomentumDeriv = Coor ,
- class Time = Value ,
- class Algebra = typename algebra_dispatcher< Coor >::algebra_type ,
- class Operations = typename operations_dispatcher< Coor >::operations_type ,
- class Resizer = initially_resizer
- >
- #ifndef DOXYGEN_SKIP
- class symplectic_rkn_sb3a_mclachlan :
- public symplectic_nystroem_stepper_base
- <
- 6 , 4 ,
- Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer
- >
- #else
- class symplectic_rkn_sb3a_mclachlan : public symplectic_nystroem_stepper_base
- #endif
- {
- public:
- #ifndef DOXYGEN_SKIP
- typedef symplectic_nystroem_stepper_base
- <
- 6 , 4 ,
- Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer
- > stepper_base_type;
- #endif
- typedef typename stepper_base_type::algebra_type algebra_type;
- typedef typename stepper_base_type::value_type value_type;
- symplectic_rkn_sb3a_mclachlan( const algebra_type &algebra = algebra_type() )
- : stepper_base_type(
- detail::symplectic_rkn_sb3a_mclachlan::coef_a_type< value_type >() ,
- detail::symplectic_rkn_sb3a_mclachlan::coef_b_type< value_type >() ,
- algebra )
- { }
- };
-
- }
- }
- }
- #endif
|