Chris@16: /* Chris@16: [auto_generated] Chris@16: boost/numeric/odeint/stepper/symplectic_euler.hpp Chris@16: Chris@16: [begin_description] Chris@16: Implementation of the symplectic Euler for separable Hamiltonian systems. Chris@16: [end_description] Chris@16: Chris@101: Copyright 2011-2013 Karsten Ahnert Chris@101: Copyright 2011-2013 Mario Mulansky Chris@16: Chris@16: Distributed under the Boost Software License, Version 1.0. Chris@16: (See accompanying file LICENSE_1_0.txt or Chris@16: copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: */ Chris@16: Chris@16: Chris@16: #ifndef BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_EULER_HPP_INCLUDED Chris@16: #define BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_EULER_HPP_INCLUDED Chris@16: Chris@16: Chris@16: #include Chris@16: Chris@16: #include Chris@16: #include Chris@101: #include Chris@101: #include Chris@16: Chris@16: #include Chris@16: Chris@16: namespace boost { Chris@16: namespace numeric { Chris@16: namespace odeint { Chris@16: Chris@16: Chris@16: #ifndef DOXYGEN_SKIP Chris@16: namespace detail { Chris@16: namespace symplectic_euler_coef { Chris@16: Chris@16: template< class Value > Chris@16: struct coef_a_type : public boost::array< Value , 1 > Chris@16: { Chris@16: coef_a_type( void ) Chris@16: { Chris@16: (*this)[0] = static_cast< Value >( 1 ); Chris@16: } Chris@16: }; Chris@16: Chris@16: template< class Value > Chris@16: struct coef_b_type : public boost::array< Value , 1 > Chris@16: { Chris@16: coef_b_type( void ) Chris@16: { Chris@16: (*this)[0] = static_cast< Value >( 1 ); Chris@16: } Chris@16: }; Chris@16: Chris@16: } // namespace symplectic_euler_coef Chris@16: } // namespace detail Chris@16: #endif Chris@16: Chris@16: Chris@16: Chris@16: template< Chris@16: class Coor , Chris@16: class Momentum = Coor , Chris@16: class Value = double , Chris@16: class CoorDeriv = Coor , Chris@16: class MomentumDeriv = Coor , Chris@16: class Time = Value , Chris@101: class Algebra = typename algebra_dispatcher< Coor >::algebra_type , Chris@101: class Operations = typename operations_dispatcher< Coor >::operations_type , Chris@16: class Resizer = initially_resizer Chris@16: > Chris@16: #ifndef DOXYGEN_SKIP Chris@16: class symplectic_euler : Chris@16: public symplectic_nystroem_stepper_base Chris@16: < Chris@16: 1 , 1 , Chris@16: Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer Chris@16: > Chris@16: #else Chris@16: class symplectic_euler : public symplectic_nystroem_stepper_base Chris@16: #endif Chris@16: { Chris@16: public: Chris@16: Chris@16: #ifndef DOXYGEN_SKIP Chris@16: typedef symplectic_nystroem_stepper_base< Chris@16: 1 , 1 , Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer > stepper_base_type; Chris@16: #endif Chris@16: typedef typename stepper_base_type::algebra_type algebra_type; Chris@16: typedef typename stepper_base_type::value_type value_type; Chris@16: Chris@16: Chris@16: symplectic_euler( const algebra_type &algebra = algebra_type() ) Chris@16: : stepper_base_type( detail::symplectic_euler_coef::coef_a_type< value_type >() , Chris@16: detail::symplectic_euler_coef::coef_b_type< value_type >() , Chris@16: algebra ) Chris@16: { } Chris@16: }; Chris@16: Chris@16: Chris@16: /*************** DOXYGEN ***************/ Chris@16: Chris@16: /** Chris@16: * \class symplectic_euler Chris@16: * \brief Implementation of the symplectic Euler method. Chris@16: * Chris@16: * The method is of first order and has one stage. It is described HERE. Chris@16: * Chris@16: * \tparam Order The order of the stepper. Chris@16: * \tparam Coor The type representing the coordinates q. Chris@16: * \tparam Momentum The type representing the coordinates p. Chris@16: * \tparam Value The basic value type. Should be something like float, double or a high-precision type. Chris@16: * \tparam CoorDeriv The type representing the time derivative of the coordinate dq/dt. Chris@16: * \tparam MomemtnumDeriv The type representing the time derivative of the momentum dp/dt. Chris@16: * \tparam Time The type representing the time t. Chris@16: * \tparam Algebra The algebra. Chris@16: * \tparam Operations The operations. Chris@16: * \tparam Resizer The resizer policy. Chris@16: */ Chris@16: Chris@16: /** Chris@16: * \fn symplectic_euler::symplectic_euler( const algebra_type &algebra ) Chris@16: * \brief Constructs the symplectic_euler. This constructor can be used as a default Chris@16: * constructor if the algebra has a default constructor. Chris@16: * \param algebra A copy of algebra is made and stored inside explicit_stepper_base. Chris@16: */ Chris@16: Chris@16: } // namespace odeint Chris@16: } // namespace numeric Chris@16: } // namespace boost Chris@16: Chris@16: Chris@16: #endif // BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_EULER_HPP_INCLUDED