Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:42:57

0001 /*
0002  [auto_generated]
0003  boost/numeric/odeint/stepper/symplectic_euler.hpp
0004 
0005  [begin_description]
0006  Implementation of the symplectic Euler for separable Hamiltonian systems.
0007  [end_description]
0008 
0009  Copyright 2011-2013 Karsten Ahnert
0010  Copyright 2011-2013 Mario Mulansky
0011 
0012  Distributed under the Boost Software License, Version 1.0.
0013  (See accompanying file LICENSE_1_0.txt or
0014  copy at http://www.boost.org/LICENSE_1_0.txt)
0015  */
0016 
0017 
0018 #ifndef BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_EULER_HPP_INCLUDED
0019 #define BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_EULER_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/array.hpp>
0030 
0031 namespace boost {
0032 namespace numeric {
0033 namespace odeint {
0034 
0035 
0036 #ifndef DOXYGEN_SKIP
0037 namespace detail {
0038 namespace symplectic_euler_coef {
0039 
0040 template< class Value >
0041 struct coef_a_type : public boost::array< Value , 1 >
0042 {
0043     coef_a_type( void )
0044     {
0045         (*this)[0] = static_cast< Value >( 1 );
0046     }
0047 };
0048 
0049 template< class Value >
0050 struct coef_b_type : public boost::array< Value , 1 >
0051 {
0052     coef_b_type( void )
0053     {
0054         (*this)[0] = static_cast< Value >( 1 );
0055     }
0056 };
0057 
0058 } // namespace symplectic_euler_coef
0059 } // namespace detail
0060 #endif
0061 
0062 
0063 
0064 template<
0065 class Coor ,
0066 class Momentum = Coor ,
0067 class Value = double ,
0068 class CoorDeriv = Coor ,
0069 class MomentumDeriv = Coor ,
0070 class Time = Value ,
0071 class Algebra = typename algebra_dispatcher< Coor >::algebra_type ,
0072 class Operations = typename operations_dispatcher< Coor >::operations_type ,
0073 class Resizer = initially_resizer
0074 >
0075 #ifndef DOXYGEN_SKIP
0076 class symplectic_euler :
0077 public symplectic_nystroem_stepper_base
0078 <
0079 1 , 1 ,
0080 Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer
0081 >
0082 #else
0083 class symplectic_euler : public symplectic_nystroem_stepper_base
0084 #endif
0085 {
0086 public:
0087 
0088 #ifndef DOXYGEN_SKIP
0089     typedef symplectic_nystroem_stepper_base<
0090     1 , 1 , Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer > stepper_base_type;
0091 #endif
0092     typedef typename stepper_base_type::algebra_type algebra_type;
0093     typedef typename stepper_base_type::value_type value_type;
0094 
0095 
0096     symplectic_euler( const algebra_type &algebra = algebra_type() )
0097     : stepper_base_type( detail::symplectic_euler_coef::coef_a_type< value_type >() ,
0098             detail::symplectic_euler_coef::coef_b_type< value_type >() ,
0099             algebra )
0100     { }
0101 };
0102 
0103 
0104 /*************** DOXYGEN ***************/
0105 
0106 /**
0107  * \class symplectic_euler
0108  * \brief Implementation of the symplectic Euler method.
0109  *
0110  * The method is of first order and has one stage. It is described HERE.
0111  *
0112  * \tparam Order The order of the stepper.
0113  * \tparam Coor The type representing the coordinates q.
0114  * \tparam Momentum The type representing the coordinates p.
0115  * \tparam Value The basic value type. Should be something like float, double or a high-precision type.
0116  * \tparam CoorDeriv The type representing the time derivative of the coordinate dq/dt.
0117  * \tparam MomemtnumDeriv The type representing the time derivative of the momentum dp/dt.
0118  * \tparam Time The type representing the time t.
0119  * \tparam Algebra The algebra.
0120  * \tparam Operations The operations.
0121  * \tparam Resizer The resizer policy.
0122  */
0123 
0124     /**
0125      * \fn symplectic_euler::symplectic_euler( const algebra_type &algebra )
0126      * \brief Constructs the symplectic_euler. This constructor can be used as a default
0127      * constructor if the algebra has a default constructor.
0128      * \param algebra A copy of algebra is made and stored inside explicit_stepper_base.
0129      */
0130 
0131 } // namespace odeint
0132 } // namespace numeric
0133 } // namespace boost
0134 
0135 
0136 #endif // BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_EULER_HPP_INCLUDED