File indexing completed on 2025-01-18 09:42:57
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_RKN_SB3A_MCLACHLAN_HPP_INCLUDED
0019 #define BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_RKN_SB3A_MCLACHLAN_HPP_INCLUDED
0020
0021
0022 #include <boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp>
0023
0024 #include <boost/numeric/odeint/algebra/range_algebra.hpp>
0025 #include <boost/numeric/odeint/algebra/default_operations.hpp>
0026 #include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
0027 #include <boost/numeric/odeint/algebra/operations_dispatcher.hpp>
0028
0029 #include <boost/numeric/odeint/util/resizer.hpp>
0030
0031 #include <boost/array.hpp>
0032
0033 namespace boost {
0034 namespace numeric {
0035 namespace odeint {
0036
0037
0038 #ifndef DOXYGEN_SKIP
0039 namespace detail {
0040 namespace symplectic_rkn_sb3a_mclachlan {
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050 template< class Value >
0051 struct coef_a_type : public boost::array< Value , 6 >
0052 {
0053 coef_a_type( void )
0054 {
0055 (*this)[0] = static_cast< Value >( 0.40518861839525227722 );
0056 (*this)[1] = static_cast< Value >( -0.28714404081652408900 );
0057 (*this)[2] = static_cast< Value >( 1 ) / static_cast< Value >( 2 ) - ( (*this)[0] + (*this)[1] );
0058 (*this)[3] = (*this)[2];
0059 (*this)[4] = (*this)[1];
0060 (*this)[5] = (*this)[0];
0061
0062 }
0063 };
0064
0065 template< class Value >
0066 struct coef_b_type : public boost::array< Value , 6 >
0067 {
0068 coef_b_type( void )
0069 {
0070 (*this)[0] = static_cast< Value >( -3 ) / static_cast< Value >( 73 );
0071 (*this)[1] = static_cast< Value >( 17 ) / static_cast< Value >( 59 );
0072 (*this)[2] = static_cast< Value >( 1 ) - static_cast< Value >( 2 ) * ( (*this)[0] + (*this)[1] );
0073 (*this)[3] = (*this)[1];
0074 (*this)[4] = (*this)[0];
0075 (*this)[5] = static_cast< Value >( 0 );
0076 }
0077 };
0078
0079 }
0080 }
0081 #endif
0082
0083
0084
0085 template<
0086 class Coor ,
0087 class Momentum = Coor ,
0088 class Value = double ,
0089 class CoorDeriv = Coor ,
0090 class MomentumDeriv = Coor ,
0091 class Time = Value ,
0092 class Algebra = typename algebra_dispatcher< Coor >::algebra_type ,
0093 class Operations = typename operations_dispatcher< Coor >::operations_type ,
0094 class Resizer = initially_resizer
0095 >
0096 #ifndef DOXYGEN_SKIP
0097 class symplectic_rkn_sb3a_mclachlan :
0098 public symplectic_nystroem_stepper_base
0099 <
0100 6 , 4 ,
0101 Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer
0102 >
0103 #else
0104 class symplectic_rkn_sb3a_mclachlan : public symplectic_nystroem_stepper_base
0105 #endif
0106 {
0107 public:
0108 #ifndef DOXYGEN_SKIP
0109 typedef symplectic_nystroem_stepper_base
0110 <
0111 6 , 4 ,
0112 Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer
0113 > stepper_base_type;
0114 #endif
0115 typedef typename stepper_base_type::algebra_type algebra_type;
0116 typedef typename stepper_base_type::value_type value_type;
0117
0118
0119 symplectic_rkn_sb3a_mclachlan( const algebra_type &algebra = algebra_type() )
0120 : stepper_base_type(
0121 detail::symplectic_rkn_sb3a_mclachlan::coef_a_type< value_type >() ,
0122 detail::symplectic_rkn_sb3a_mclachlan::coef_b_type< value_type >() ,
0123 algebra )
0124 { }
0125 };
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157
0158 }
0159 }
0160 }
0161
0162 #endif