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_M4_MCLACHLAN_HPP_DEFINED
0019 #define BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_RKN_SB3A_M4_MCLACHLAN_HPP_DEFINED
0020
0021 #include <boost/numeric/odeint/algebra/default_operations.hpp>
0022 #include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
0023 #include <boost/numeric/odeint/algebra/operations_dispatcher.hpp>
0024
0025 #include <boost/numeric/odeint/util/resizer.hpp>
0026
0027
0028 namespace boost {
0029 namespace numeric {
0030 namespace odeint {
0031
0032 #ifndef DOXYGEN_SKIP
0033 namespace detail {
0034 namespace symplectic_rkn_sb3a_m4_mclachlan {
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046 template< class Value >
0047 struct coef_a_type : public boost::array< Value , 5 >
0048 {
0049 coef_a_type( void )
0050 {
0051 using std::sqrt;
0052
0053 Value z = sqrt( static_cast< Value >( 7 ) / static_cast< Value >( 8 ) ) / static_cast< Value >( 3 );
0054 (*this)[0] = static_cast< Value >( 1 ) / static_cast< Value >( 2 ) - z ;
0055 (*this)[1] = static_cast< Value >( -1 ) / static_cast< Value >( 3 ) + z ;
0056 (*this)[2] = static_cast< Value >( 2 ) / static_cast< Value >( 3 );
0057 (*this)[3] = (*this)[1];
0058 (*this)[4] = (*this)[0];
0059 }
0060 };
0061
0062 template< class Value >
0063 struct coef_b_type : public boost::array< Value , 5 >
0064 {
0065 coef_b_type( void )
0066 {
0067 (*this)[0] = static_cast< Value >( 1 );
0068 (*this)[1] = static_cast< Value >( -1 ) / static_cast< Value >( 2 );
0069 (*this)[2] = (*this)[1];
0070 (*this)[3] = (*this)[0];
0071 (*this)[4] = static_cast< Value >( 0 );
0072 }
0073 };
0074
0075 }
0076 }
0077 #endif
0078
0079
0080
0081
0082 template<
0083 class Coor ,
0084 class Momentum = Coor ,
0085 class Value = double ,
0086 class CoorDeriv = Coor ,
0087 class MomentumDeriv = Coor ,
0088 class Time = Value ,
0089 class Algebra = typename algebra_dispatcher< Coor >::algebra_type ,
0090 class Operations = typename operations_dispatcher< Coor >::operations_type ,
0091 class Resizer = initially_resizer
0092 >
0093 #ifndef DOXYGEN_SKIP
0094 class symplectic_rkn_sb3a_m4_mclachlan :
0095 public symplectic_nystroem_stepper_base
0096 <
0097 5 , 4 ,
0098 Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer
0099 >
0100 #else
0101 class symplectic_rkn_sb3a_m4_mclachlan : public symplectic_nystroem_stepper_base
0102 #endif
0103 {
0104 public:
0105 #ifndef DOXYGEN_SKIP
0106 typedef symplectic_nystroem_stepper_base
0107 <
0108 5 , 4 ,
0109 Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer
0110 > stepper_base_type;
0111 #endif
0112 typedef typename stepper_base_type::algebra_type algebra_type;
0113 typedef typename stepper_base_type::value_type value_type;
0114
0115
0116 symplectic_rkn_sb3a_m4_mclachlan( const algebra_type &algebra = algebra_type() )
0117 : stepper_base_type(
0118 detail::symplectic_rkn_sb3a_m4_mclachlan::coef_a_type< value_type >() ,
0119 detail::symplectic_rkn_sb3a_m4_mclachlan::coef_b_type< value_type >() ,
0120 algebra )
0121 { }
0122 };
0123
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 #endif