Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71607 - sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta
From: mario.mulansky_at_[hidden]
Date: 2011-04-29 13:37:51


Author: mariomulansky
Date: 2011-04-29 13:37:51 EDT (Fri, 29 Apr 2011)
New Revision: 71607
URL: http://svn.boost.org/trac/boost/changeset/71607

Log:
+explicit error
Added:
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/fusion_explicit_error_rk.hpp (contents, props changed)

Added: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/fusion_explicit_error_rk.hpp
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/fusion_explicit_error_rk.hpp 2011-04-29 13:37:51 EDT (Fri, 29 Apr 2011)
@@ -0,0 +1,58 @@
+/*
+ * fusion_explicit_error_rk.hpp
+ *
+ * Created on: Apr 29, 2011
+ * Author: mario
+ */
+
+#ifndef FUSION_EXPLICIT_ERROR_RK_HPP_
+#define FUSION_EXPLICIT_ERROR_RK_HPP_
+
+#include "fusion_explicit_rk_new.hpp"
+#include "fusion_algebra.hpp"
+
+namespace mpl = boost::mpl;
+namespace fusion = boost::fusion;
+
+using namespace std;
+
+template< class StateType , size_t stage_count >
+class explicit_error_rk : public explicit_rk< StateType , stage_count >
+{
+
+public:
+
+ typedef explicit_rk< StateType , stage_count > base;
+
+ typedef StateType state_type;
+
+ typedef typename base::stage_indices stage_indices;
+
+ typedef typename base::coef_a_type coef_a_type;
+
+ typedef typename base::coef_b_type coef_b_type;
+ typedef typename base::coef_c_type coef_c_type;
+
+ public:
+
+ explicit_error_rk( const coef_a_type &a ,
+ const coef_b_type &b ,
+ const coef_b_type &b2 ,
+ const coef_c_type &c )
+ : base( a , b , c ) , m_b2( b2 )
+ { }
+
+ template< class System >
+ void do_step( System &system , state_type &x , double t , const double dt , state_type &x_err )
+ {
+ base::do_step( system , x , t , dt );
+ // compute error estimate
+ fusion_algebra< stage_count >::foreach( x_err , m_b2 , base::m_F , dt );
+ }
+
+private:
+
+ const coef_b_type m_b2;
+};
+
+#endif /* FUSION_EXPLICIT_ERROR_RK_HPP_ */


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