Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68585 - in sandbox/odeint/branches/karsten: . boost/numeric/odeint/integrate boost/numeric/odeint/integrate/detail boost/numeric/odeint/stepper
From: karsten.ahnert_at_[hidden]
Date: 2011-01-31 10:10:45


Author: karsten
Date: 2011-01-31 10:10:45 EST (Mon, 31 Jan 2011)
New Revision: 68585
URL: http://svn.boost.org/trac/boost/changeset/68585

Log:
* starting integration methods
Added:
   sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/
   sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/detail/
   sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/detail/integrate_const.hpp (contents, props changed)
   sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/integrate.hpp (contents, props changed)
Text files modified:
   sandbox/odeint/branches/karsten/TODO | 5 +++--
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/stepper_categories.hpp | 17 ++++++++++++++---
   2 files changed, 17 insertions(+), 5 deletions(-)

Modified: sandbox/odeint/branches/karsten/TODO
==============================================================================
--- sandbox/odeint/branches/karsten/TODO (original)
+++ sandbox/odeint/branches/karsten/TODO 2011-01-31 10:10:45 EST (Mon, 31 Jan 2011)
@@ -11,7 +11,7 @@
   * split check_concepts into check_stepper_concept, check_error_stepper_concept, check_controlled_stepper_concept
   * include test/thrust in jam system, use system from
 * implicit euler, include dfdt
-* include rosenbrock4 in trunk
+* same interface for implicit_euler and rosenbrock4
 DIFFICULT * finishing change of controlled_stepper to units
   * check if rosenbrock controller and controlled_stepper can both be used with the explicit steppers
   OK * move error_checker into controlled_stepper
@@ -56,4 +56,5 @@
   OK * test standard_algebra
   OK * test fusion_algebra
   OK * test, if copy construct of stepper_base is called when explicit_euler is used
- OK * test units with dense output
\ No newline at end of file
+ OK * test units with dense output
+OK * include rosenbrock4 in trunk
\ No newline at end of file

Added: sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/detail/integrate_const.hpp
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/detail/integrate_const.hpp 2011-01-31 10:10:45 EST (Mon, 31 Jan 2011)
@@ -0,0 +1,47 @@
+/*
+ * integrate_const_stepper.hpp
+ *
+ * Created on: Jan 31, 2011
+ * Author: karsten
+ */
+
+#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_CONST_HPP_
+#define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_CONST_HPP_
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+namespace detail {
+
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate_const( Stepper stepper , System system , State &start_state , const Time &start_time , const Time &end_time , const Time &dt , Observer observer , stepper_tag )
+{
+ return 0;
+}
+
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate_const( Stepper stepper , System system , State &start_state , const Time &start_time , const Time &end_time , const Time &dt , Observer observer , error_stepper_tag )
+{
+ return 0;
+}
+
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate_const( Stepper stepper , System system , State &start_state , const Time &start_time , const Time &end_time , const Time &dt , Observer observer , controlled_stepper_tag )
+{
+ return 0;
+}
+
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate_const( Stepper stepper , System system , State &start_state , const Time &start_time , const Time &end_time , const Time &dt , Observer observer , dense_output_stepper_tag )
+{
+ return 0;
+}
+
+
+} // namespace detail
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+#endif /* BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_CONST_HPP_ */

Added: sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/integrate.hpp
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/integrate.hpp 2011-01-31 10:10:45 EST (Mon, 31 Jan 2011)
@@ -0,0 +1,79 @@
+/*
+ * integrate_const.hpp
+ *
+ * Created on: Jan 31, 2011
+ * Author: karsten
+ */
+
+#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_HPP_
+#define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_CONST_HPP_
+
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+#include <boost/numeric/odeint/integrate/detail/integrate_const.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+/*
+
+Overview:
+
+size_t integrate( stepper , system , start_state , start_time , end_time , dt , observer );
+
+Time integrate_n_steps( stepper , system , start_state , start_time , num_of_steps , observer );
+
+void integrate_adaptive( stepper , system , start_state , start_time , end_time , start_dt , observer );
+void integrate_adaptive( stepper , system , start_state , start_time , end_time , start_dt , state_back_insert_sequence , time_back_insert_sequence );
+
+*/
+
+
+
+template< class Stepper , class system , class State , class Time , class Observer = empty_observer >
+size_t integrate( Stepper stepper , System system , State &start_state , const Time &start_time , const Time &end_time , const Time &dt , Observer observer = Observer() )
+{
+ // we want to get as fast as possible to the end
+ if( typename boost:is_same< empty_observer , Observer >::value )
+ {
+ return detail::integrate_adpative( stepper , system , start_state , start_time , end_time , dt , Observer , typename Stepper::stepper_type() );
+ }
+ else
+ {
+ return detail::integrate_const( stepper , system , start_state , start_time , end_time , dt , Observer , typename Stepper::stepper_type() );
+ }
+}
+
+
+
+
+
+/*
+ * Old integrate functions
+ */
+
+// Constant integrator
+//size_t integrate_const( stepper , system , state , start_time , end_time , dt , observer );
+//size_t integrate_const( stepper , system , state , start_time , end_time , dt );
+//time_type integrate_const_steps( stepper , system , state , start_time , dt , num_of_steps , observer );
+//time_type integrate_const_steps( stepper , system , state , start_time , dt , num_of_steps );
+//
+//// Adaptive integrators
+//size_t integrate_adaptive( stepper, system , state , start_time , end_time , dt , observer );
+//size_t integrate_adaptive( stepper, system , state , start_time , end_time , dt );
+//size_t integrate( stepper , system , state , start_time , end_end , dt , time_inserter , state_inserter );
+//size_t integrate( system , state,start_time , end_time , time_inserter , state_inserter , dt = 1E-4 , eps_abs = 1E-6 , eps_rel = 1E-7 , a_x = 1.0 , a_dxdt = 1.0 );
+
+
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+
+#endif /* BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_CONST_HPP_ */

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/stepper_categories.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/stepper_categories.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/stepper_categories.hpp 2011-01-31 10:10:45 EST (Mon, 31 Jan 2011)
@@ -19,14 +19,25 @@
 
 /*
  * Tags to specify stepper types
+ *
+ * These tags are used by integrate() to choose which integration method is used
  */
 
 struct stepper_tag {};
+//struct explicit_stepper_tag : stepper_tag {};
+//struct implicit_stepper_tag : stepper_tag {};
+
 struct error_stepper_tag {};
-struct dense_output_stepper_tag {} ;
+//struct explicit_error_stepper_tag : error_stepper_tag {};
+//struct explicit_error_stepper_fsal_tag : error_stepper_tag {};
+
+struct controlled_stepper_tag {};
+//struct controlled_explicit_stepper_tag : controlled_stepper_tag {};
+//struct controlled_implicit_stepper_tag : controlled_stepper_tag {};
+
+struct dense_output_stepper_tag {};
+
 
-struct explicit_error_stepper_tag : error_stepper_tag {};
-struct explicit_error_stepper_fsal_tag : error_stepper_tag {};
 
 } // odeint
 } // numeric


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk