Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new typedef system_category to all steppers. #226

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/boost/numeric/odeint/stepper/adams_bashforth.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <boost/numeric/odeint/util/resizer.hpp>

#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>
#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
#include <boost/numeric/odeint/stepper/extrapolation_stepper.hpp>

Expand Down Expand Up @@ -99,6 +100,7 @@ public :
typedef Time time_type;
typedef Resizer resizer_type;
typedef stepper_tag stepper_category;
typedef explicit_system_tag system_category;

typedef InitializingStepper initializing_stepper_type;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <boost/numeric/odeint/util/bind.hpp>

#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>
#include <boost/numeric/odeint/algebra/range_algebra.hpp>
#include <boost/numeric/odeint/algebra/default_operations.hpp>
#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
Expand Down Expand Up @@ -73,6 +74,7 @@ public :
typedef Resizer resizer_type;
typedef stepper_tag stepper_category;
typedef InitializingStepper initializing_stepper_type;
typedef explicit_system_tag system_category;

static const size_t steps = Steps;
#ifndef DOXYGEN_SKIP
Expand Down
2 changes: 2 additions & 0 deletions include/boost/numeric/odeint/stepper/bulirsch_stoer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp>
#include <boost/numeric/odeint/stepper/modified_midpoint.hpp>
#include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>
#include <boost/numeric/odeint/algebra/range_algebra.hpp>
#include <boost/numeric/odeint/algebra/default_operations.hpp>
#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
Expand Down Expand Up @@ -70,6 +71,7 @@ class bulirsch_stoer {
typedef Algebra algebra_type;
typedef Operations operations_type;
typedef Resizer resizer_type;
typedef explicit_system_tag system_category;
#ifndef DOXYGEN_SKIP
typedef state_wrapper< state_type > wrapped_state_type;
typedef state_wrapper< deriv_type > wrapped_deriv_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp>
#include <boost/numeric/odeint/stepper/modified_midpoint.hpp>
#include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>
#include <boost/numeric/odeint/algebra/range_algebra.hpp>
#include <boost/numeric/odeint/algebra/default_operations.hpp>
#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
Expand Down Expand Up @@ -74,6 +75,7 @@ class bulirsch_stoer_dense_out {
typedef Operations operations_type;
typedef Resizer resizer_type;
typedef dense_output_stepper_tag stepper_category;
typedef explicit_system_tag system_category;
#ifndef DOXYGEN_SKIP
typedef state_wrapper< state_type > wrapped_state_type;
typedef state_wrapper< deriv_type > wrapped_deriv_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

#include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>

namespace boost {
namespace numeric {
Expand Down Expand Up @@ -229,6 +230,7 @@ class controlled_runge_kutta< ErrorStepper , ErrorChecker , StepAdjuster, Resize
typedef ErrorChecker error_checker_type;
typedef StepAdjuster step_adjuster_type;
typedef explicit_controlled_stepper_tag stepper_category;
typedef explicit_system_tag system_category;

#ifndef DOXYGEN_SKIP
typedef typename stepper_type::wrapped_state_type wrapped_state_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

#include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>

#include <boost/numeric/odeint/integrate/max_step_checker.hpp>

Expand Down Expand Up @@ -81,6 +82,7 @@ class dense_output_runge_kutta< Stepper , stepper_tag >
typedef typename stepper_type::resizer_type resizer_type;
typedef dense_output_stepper_tag stepper_category;
typedef dense_output_runge_kutta< Stepper > dense_output_stepper_type;
typedef explicit_system_tag system_category;


/**
Expand Down
2 changes: 2 additions & 0 deletions include/boost/numeric/odeint/stepper/euler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@


#include <boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>
#include <boost/numeric/odeint/algebra/range_algebra.hpp>
#include <boost/numeric/odeint/algebra/default_operations.hpp>
Expand Down Expand Up @@ -64,6 +65,7 @@ public :
typedef typename stepper_base_type::algebra_type algebra_type;
typedef typename stepper_base_type::operations_type operations_type;
typedef typename stepper_base_type::resizer_type resizer_type;
typedef explicit_system_tag system_category;

#ifndef DOXYGEN_SKIP
typedef typename stepper_base_type::stepper_type stepper_type;
Expand Down
2 changes: 2 additions & 0 deletions include/boost/numeric/odeint/stepper/implicit_euler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <boost/numeric/odeint/util/bind.hpp>
#include <boost/numeric/odeint/util/unwrap_reference.hpp>
#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>

#include <boost/numeric/odeint/util/ublas_wrapper.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
Expand Down Expand Up @@ -64,6 +65,7 @@ class implicit_euler
typedef Resizer resizer_type;
typedef stepper_tag stepper_category;
typedef implicit_euler< ValueType , Resizer > stepper_type;
typedef implicit_system_tag system_category;

implicit_euler( value_type epsilon = 1E-6 )
: m_epsilon( epsilon )
Expand Down
2 changes: 2 additions & 0 deletions include/boost/numeric/odeint/stepper/modified_midpoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <vector>

#include <boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
#include <boost/numeric/odeint/algebra/range_algebra.hpp>
Expand Down Expand Up @@ -69,6 +70,7 @@ public :
typedef typename stepper_base_type::operations_type operations_type;
typedef typename stepper_base_type::resizer_type resizer_type;
typedef typename stepper_base_type::stepper_type stepper_type;
typedef explicit_system_tag system_category;


modified_midpoint( unsigned short steps = 2 , const algebra_type &algebra = algebra_type() )
Expand Down
2 changes: 2 additions & 0 deletions include/boost/numeric/odeint/stepper/rosenbrock4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <boost/numeric/ublas/lu.hpp>

#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>

#include <boost/numeric/odeint/util/ublas_wrapper.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
Expand Down Expand Up @@ -141,6 +142,7 @@ class rosenbrock4
typedef Resizer resizer_type;
typedef Coefficients rosenbrock_coefficients;
typedef stepper_tag stepper_category;
typedef implicit_system_tag system_category;
typedef unsigned short order_type;

typedef state_wrapper< state_type > wrapped_state_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <boost/numeric/odeint/util/bind.hpp>

#include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>
#include <boost/numeric/odeint/stepper/stepper_categories.hpp>

#include <boost/numeric/odeint/util/copy.hpp>
Expand Down Expand Up @@ -52,6 +53,7 @@ class rosenbrock4_controller
typedef typename stepper_type::wrapped_deriv_type wrapped_deriv_type;
typedef typename stepper_type::resizer_type resizer_type;
typedef controlled_stepper_tag stepper_category;
typedef implicit_system_tag system_category;

typedef rosenbrock4_controller< Stepper > controller_type;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <boost/numeric/odeint/util/bind.hpp>

#include <boost/numeric/odeint/stepper/rosenbrock4_controller.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>

#include <boost/numeric/odeint/integrate/max_step_checker.hpp>
Expand All @@ -50,6 +51,7 @@ class rosenbrock4_dense_output
typedef typename stepper_type::wrapped_deriv_type wrapped_deriv_type;
typedef typename stepper_type::resizer_type resizer_type;
typedef dense_output_stepper_tag stepper_category;
typedef implicit_system_tag system_category;

typedef rosenbrock4_dense_output< ControlledStepper > dense_output_stepper_type;

Expand Down
2 changes: 2 additions & 0 deletions include/boost/numeric/odeint/stepper/runge_kutta4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <boost/fusion/container/generation/make_vector.hpp>

#include <boost/numeric/odeint/stepper/explicit_generic_rk.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>
#include <boost/numeric/odeint/algebra/range_algebra.hpp>
#include <boost/numeric/odeint/algebra/default_operations.hpp>
#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
Expand Down Expand Up @@ -129,6 +130,7 @@ class runge_kutta4 : public explicit_generic_rk
typedef typename stepper_base_type::algebra_type algebra_type;
typedef typename stepper_base_type::operations_type operations_type;
typedef typename stepper_base_type::resizer_type resizer_type;
typedef explicit_system_tag system_category;

#ifndef DOXYGEN_SKIP
typedef typename stepper_base_type::wrapped_state_type wrapped_state_type;
Expand Down
2 changes: 2 additions & 0 deletions include/boost/numeric/odeint/stepper/runge_kutta4_classic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@


#include <boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>
#include <boost/numeric/odeint/algebra/range_algebra.hpp>
#include <boost/numeric/odeint/algebra/default_operations.hpp>
#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
Expand Down Expand Up @@ -71,6 +72,7 @@ public :
typedef typename stepper_base_type::algebra_type algebra_type;
typedef typename stepper_base_type::operations_type operations_type;
typedef typename stepper_base_type::resizer_type resizer_type;
typedef explicit_system_tag system_category;

#ifndef DOXYGEN_SKIP
typedef typename stepper_base_type::stepper_type stepper_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <boost/fusion/container/generation/make_vector.hpp>

#include <boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>
#include <boost/numeric/odeint/algebra/range_algebra.hpp>
#include <boost/numeric/odeint/algebra/default_operations.hpp>
#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
Expand Down Expand Up @@ -172,6 +173,7 @@ class runge_kutta_cash_karp54 : public explicit_error_generic_rk
typedef typename stepper_base_type::algebra_type algebra_type;
typedef typename stepper_base_type::operations_type operations_type;
typedef typename stepper_base_type::resizer_type resizer_typ;
typedef explicit_system_tag system_category;

#ifndef DOXYGEN_SKIP
typedef typename stepper_base_type::stepper_type stepper_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <boost/numeric/odeint/util/bind.hpp>

#include <boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>
#include <boost/numeric/odeint/algebra/range_algebra.hpp>
#include <boost/numeric/odeint/algebra/default_operations.hpp>
#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
Expand Down Expand Up @@ -76,6 +77,7 @@ public :
typedef typename stepper_base_type::algebra_type algebra_type;
typedef typename stepper_base_type::operations_type operations_type;
typedef typename stepper_base_type::resizer_type resizer_type;
typedef explicit_system_tag system_category;

#ifndef DOXYGEN_SKIP
typedef typename stepper_base_type::wrapped_state_type wrapped_state_type;
Expand Down
2 changes: 2 additions & 0 deletions include/boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <boost/numeric/odeint/util/bind.hpp>

#include <boost/numeric/odeint/stepper/base/explicit_error_stepper_fsal_base.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>
#include <boost/numeric/odeint/algebra/range_algebra.hpp>
#include <boost/numeric/odeint/algebra/default_operations.hpp>
#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
Expand Down Expand Up @@ -76,6 +77,7 @@ public :
typedef typename stepper_base_type::algebra_type algebra_type;
typedef typename stepper_base_type::operations_type operations_type;
typedef typename stepper_base_type::resizer_type resizer_type;
typedef explicit_system_tag system_category;

#ifndef DOXYGEN_SKIP
typedef typename stepper_base_type::stepper_type stepper_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <boost/fusion/container/generation/make_vector.hpp>

#include <boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>
#include <boost/numeric/odeint/algebra/range_algebra.hpp>
#include <boost/numeric/odeint/algebra/default_operations.hpp>
#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
Expand Down Expand Up @@ -317,6 +318,7 @@ class runge_kutta_fehlberg78 : public explicit_error_generic_rk
typedef typename stepper_base_type::algebra_type algebra_type;
typedef typename stepper_base_type::operations_type operations_type;
typedef typename stepper_base_type::resizer_type resizer_type;
typedef explicit_system_tag system_category;

#ifndef DOXYGEN_SKIP
typedef typename stepper_base_type::stepper_type stepper_type;
Expand Down
2 changes: 2 additions & 0 deletions include/boost/numeric/odeint/stepper/symplectic_euler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@


#include <boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>

#include <boost/numeric/odeint/algebra/range_algebra.hpp>
#include <boost/numeric/odeint/algebra/default_operations.hpp>
Expand Down Expand Up @@ -91,6 +92,7 @@ class symplectic_euler : public symplectic_nystroem_stepper_base
#endif
typedef typename stepper_base_type::algebra_type algebra_type;
typedef typename stepper_base_type::value_type value_type;
typedef symplectic_or_simple_symplectic_system_tag system_category;


symplectic_euler( const algebra_type &algebra = algebra_type() )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <boost/numeric/odeint/algebra/default_operations.hpp>
#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>

#include <boost/numeric/odeint/util/resizer.hpp>

Expand Down Expand Up @@ -111,6 +112,7 @@ class symplectic_rkn_sb3a_m4_mclachlan : public symplectic_nystroem_stepper_base
#endif
typedef typename stepper_base_type::algebra_type algebra_type;
typedef typename stepper_base_type::value_type value_type;
typedef symplectic_or_simple_symplectic_system_tag system_category;


symplectic_rkn_sb3a_m4_mclachlan( const algebra_type &algebra = algebra_type() )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@


#include <boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>

#include <boost/numeric/odeint/algebra/range_algebra.hpp>
#include <boost/numeric/odeint/algebra/default_operations.hpp>
Expand Down Expand Up @@ -114,6 +115,7 @@ class symplectic_rkn_sb3a_mclachlan : public symplectic_nystroem_stepper_base
#endif
typedef typename stepper_base_type::algebra_type algebra_type;
typedef typename stepper_base_type::value_type value_type;
typedef symplectic_or_simple_symplectic_system_tag system_category;


symplectic_rkn_sb3a_mclachlan( const algebra_type &algebra = algebra_type() )
Expand Down
44 changes: 44 additions & 0 deletions include/boost/numeric/odeint/stepper/system_categories.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
[auto_generated]
boost/numeric/odeint/stepper/system_categories.hpp

[begin_description]
Definition of all system categories.
[end_description]

Copyright 2017 Markus Friedrich

Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or
copy at http://www.boost.org/LICENSE_1_0.txt)
*/


#ifndef BOOST_NUMERIC_ODEINT_STEPPER_SYSTEM_CATEGORIES_HPP_INCLUDED
#define BOOST_NUMERIC_ODEINT_STEPPER_SYSTEM_CATEGORIES_HPP_INCLUDED

namespace boost {
namespace numeric {
namespace odeint {


/*
* Tags to specify system types
*
* These tags can be used to detect which system category is used
*/

struct explicit_system_tag {};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to define the interface expected from the different system functor here!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How? Just as (doxygen) comments?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, just a short doxy showing how this interface is being called from inside the corresponding stepper.

struct second_order_system_tag {};
struct symplectic_system_tag {};
struct simple_symplectic_system_tag {};
struct symplectic_or_simple_symplectic_system_tag {};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need 3 versions of symplectic tags? It seems only the last one is being used? If we keep all 3, shouldn't the last be derived from the two above to express the is_a relation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently all symplectic steppers support both "normal"- and simple-simplectic systems. So just having symplectic_or_simple_symplectic_system_tag is fine for now.

struct implicit_system_tag {};


} // odeint
} // numeric
} // boost


#endif // BOOST_NUMERIC_ODEINT_STEPPER_SYSTEM_CATEGORIES_HPP_INCLUDED
2 changes: 2 additions & 0 deletions include/boost/numeric/odeint/stepper/velocity_verlet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#define BOOST_NUMERIC_ODEINT_STEPPER_VELOCITY_VERLET_HPP_DEFINED

#include <boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp>
#include <boost/numeric/odeint/stepper/system_categories.hpp>
#include <boost/numeric/odeint/stepper/stepper_categories.hpp>

#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
Expand Down Expand Up @@ -71,6 +72,7 @@ class velocity_verlet : public algebra_stepper_base< Algebra , Operations >
typedef TimeSq time_square_type;
typedef Resizer resizer_type;
typedef stepper_tag stepper_category;
typedef second_order_system_tag system_category;

typedef unsigned short order_type;

Expand Down
Loading