Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-17 09:53:59

0001 /*
0002  [auto_generated]
0003  boost/numeric/odeint/integrate/integrate.hpp
0004 
0005  [begin_description]
0006  Convenience methods which choose the stepper for the current ODE.
0007  [end_description]
0008 
0009  Copyright 2009-2011 Karsten Ahnert
0010  Copyright 2009-2011 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_INTEGRATE_INTEGRATE_HPP_INCLUDED
0019 #define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_HPP_INCLUDED
0020 
0021 #include <boost/utility/enable_if.hpp>
0022 
0023 #include <boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp>
0024 #include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp>
0025 #include <boost/numeric/odeint/iterator/integrate/null_observer.hpp>
0026 #include <boost/numeric/odeint/iterator/integrate/integrate_adaptive.hpp>
0027 
0028 // for has_value_type trait
0029 #include <boost/numeric/odeint/algebra/detail/extract_value_type.hpp>
0030 
0031 
0032 namespace boost {
0033 namespace numeric {
0034 namespace odeint {
0035 
0036 
0037 /*
0038  * ToDo :
0039  *
0040  * determine type of dxdt for units
0041  *
0042  */
0043 template< class System , class State , class Time , class Observer >
0044 typename boost::enable_if< typename has_value_type<State>::type , size_t >::type
0045 integrate( System system , State &start_state , Time start_time , Time end_time , Time dt , Observer observer )
0046 {
0047     typedef controlled_runge_kutta< runge_kutta_dopri5< State , typename State::value_type , State , Time > > stepper_type;
0048     return integrate_adaptive( stepper_type() , system , start_state , start_time , end_time , dt , observer );
0049 }
0050 
0051 
0052 
0053 /*
0054  * the two overloads are needed in order to solve the forwarding problem
0055  */
0056 template< class System , class State , class Time >
0057 size_t integrate( System system , State &start_state , Time start_time , Time end_time , Time dt )
0058 {
0059     return integrate( system , start_state , start_time , end_time , dt , null_observer() );
0060 }
0061 
0062 
0063 /**
0064  * \fn integrate( System system , State &start_state , Time start_time , Time end_time , Time dt , Observer observer )
0065  * \brief Integrates the ODE.
0066  *
0067  * Integrates the ODE given by system from start_time to end_time starting 
0068  * with start_state as initial condition and dt as initial time step.
0069  * This function uses a dense output dopri5 stepper and performs an adaptive
0070  * integration with step size control, thus dt changes during the integration.
0071  * This method uses standard error bounds of 1E-6.
0072  * After each step, the observer is called.
0073  *
0074  * \param system The system function to solve, hence the r.h.s. of the 
0075  * ordinary differential equation.
0076  * \param start_state The initial state.
0077  * \param start_time Start time of the integration.
0078  * \param end_time End time of the integration.
0079  * \param dt Initial step size, will be adjusted during the integration.
0080  * \param observer Observer that will be called after each time step.
0081  * \return The number of steps performed.
0082  */
0083 
0084 
0085 /**
0086  * \fn integrate( System system , State &start_state , Time start_time , Time end_time , Time dt )
0087  * \brief Integrates the ODE without observer calls.
0088  *
0089  * Integrates the ODE given by system from start_time to end_time starting 
0090  * with start_state as initial condition and dt as initial time step.
0091  * This function uses a dense output dopri5 stepper and performs an adaptive
0092  * integration with step size control, thus dt changes during the integration.
0093  * This method uses standard error bounds of 1E-6.
0094  * No observer is called.
0095  *
0096  * \param system The system function to solve, hence the r.h.s. of the 
0097  * ordinary differential equation.
0098  * \param start_state The initial state.
0099  * \param start_time Start time of the integration.
0100  * \param end_time End time of the integration.
0101  * \param dt Initial step size, will be adjusted during the integration.
0102  * \return The number of steps performed.
0103  */
0104 
0105 } // namespace odeint
0106 } // namespace numeric
0107 } // namespace boost
0108 
0109 
0110 
0111 #endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_HPP_INCLUDED