• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2   [auto_generated]
3   libs/numeric/odeint/test/dummy_boost_units.hpp
4 
5   [begin_description]
6   tba.
7   [end_description]
8 
9   Copyright 2012 Karsten Ahnert
10   Copyright 2012 Mario Mulansky
11 
12   Distributed under the Boost Software License, Version 1.0.
13   (See accompanying file LICENSE_1_0.txt or
14   copy at http://www.boost.org/LICENSE_1_0.txt)
15 */
16 
17 
18 #ifndef LIBS_NUMERIC_ODEINT_TEST_DUMMY_BOOST_UNITS_HPP_DEFINED
19 #define LIBS_NUMERIC_ODEINT_TEST_DUMMY_BOOST_UNITS_HPP_DEFINED
20 
21 #include <boost/units/systems/si/length.hpp>
22 #include <boost/units/systems/si/time.hpp>
23 #include <boost/units/systems/si/velocity.hpp>
24 #include <boost/units/systems/si/acceleration.hpp>
25 #include <boost/units/systems/si/io.hpp>
26 
27 #include <boost/fusion/container.hpp>
28 
29 
30 
31 typedef double value_type;
32 typedef boost::units::quantity< boost::units::si::time , value_type > time_type;
33 typedef boost::units::quantity< boost::units::si::length , value_type > length_type;
34 typedef boost::units::quantity< boost::units::si::velocity , value_type > velocity_type;
35 typedef boost::units::quantity< boost::units::si::acceleration , value_type > acceleration_type;
36 
37 
38 
39 struct oscillator_mom_func_units
40 {
41     template< class Coor , class MomDeriv >
operator ()oscillator_mom_func_units42     void operator()( const Coor &q , MomDeriv &dp ) const
43     {
44         const boost::units::quantity< boost::units::si::frequency , value_type > omega = 1.0 * boost::units::si::hertz;
45         boost::fusion::at_c< 0 >( dp ) = - omega * omega * boost::fusion::at_c< 0 >( q );
46     }
47 };
48 
49 struct oscillator_coor_func_units
50 {
51     template< class Mom , class CoorDeriv >
operator ()oscillator_coor_func_units52     void operator()( const Mom &p , CoorDeriv &dq ) const
53     {
54         boost::fusion::at_c< 0 >( dq ) = boost::fusion::at_c< 0 >( p );
55     }
56 };
57 
58 
59 #endif // LIBS_NUMERIC_ODEINT_TEST_DUMMY_BOOST_UNITS_HPP_DEFINED
60