Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer > Class Template Reference

The Velocity-Verlet algorithm. More...

#include <velocity_verlet.hpp>

Inheritance diagram for boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >:
Collaboration diagram for boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >:

Public Types

typedef algebra_stepper_base
< Algebra, Operations > 
algebra_stepper_base_type
 
typedef
algebra_stepper_base_type::algebra_type 
algebra_type
 
typedef
algebra_stepper_base_type::operations_type 
operations_type
 
typedef Coor coor_type
 
typedef Velocity velocity_type
 
typedef Acceleration acceleration_type
 
typedef std::pair< coor_type,
velocity_type
state_type
 
typedef std::pair
< velocity_type,
acceleration_type
deriv_type
 
typedef state_wrapper
< acceleration_type
wrapped_acceleration_type
 
typedef Value value_type
 
typedef Time time_type
 
typedef TimeSq time_square_type
 
typedef Resizer resizer_type
 
typedef stepper_tag stepper_category
 
typedef unsigned short order_type
 

Public Member Functions

order_type order (void) const
 
 velocity_verlet (const algebra_type &algebra=algebra_type())
 Constructs the velocity_verlet class. More...
 
template<class System , class StateInOut >
void do_step (System system, StateInOut &x, time_type t, time_type dt)
 This method performs one step. More...
 
template<class System , class StateInOut >
void do_step (System system, const StateInOut &x, time_type t, time_type dt)
 This method performs one step. More...
 
template<class System , class CoorIn , class VelocityIn , class AccelerationIn , class CoorOut , class VelocityOut , class AccelerationOut >
void do_step (System system, CoorIn const &qin, VelocityIn const &pin, AccelerationIn const &ain, CoorOut &qout, VelocityOut &pout, AccelerationOut &aout, time_type t, time_type dt)
 This method performs one step. More...
 
template<class StateIn >
void adjust_size (const StateIn &x)
 Adjust the size of all temporaries in the stepper manually. More...
 
void reset (void)
 Resets the internal state of this stepper. More...
 
template<class AccelerationIn >
void initialize (const AccelerationIn &ain)
 Initializes the internal state of the stepper. More...
 
template<class System , class CoorIn , class VelocityIn >
void initialize (System system, const CoorIn &qin, const VelocityIn &pin, time_type t)
 Initializes the internal state of the stepper. More...
 
bool is_initialized (void) const
 
algebra_typealgebra ()
 
const algebra_typealgebra () const
 

Static Public Attributes

static const order_type order_value = 1
 

Protected Attributes

algebra_type m_algebra
 

Detailed Description

template<class Coor, class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
class boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >

The Velocity-Verlet algorithm.

The Velocity-Verlet algorithm is a method for simulation of molecular dynamics systems. It solves the ODE a=f(r,v',t) where r are the coordinates, v are the velocities and a are the accelerations, hence v = dr/dt, a=dv/dt.

Template Parameters
CoorThe type representing the coordinates.
VelocityThe type representing the velocities.
ValueThe type value type.
AccelerationThe type representing the acceleration.
TimeThe time representing the independent variable - the time.
TimeSqThe time representing the square of the time.
AlgebraThe algebra.
OperationsThe operations type.
ResizerThe resizer policy type.

Member Typedef Documentation

template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
typedef Acceleration boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::acceleration_type
template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
typedef algebra_stepper_base< Algebra , Operations > boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::algebra_stepper_base_type
template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
typedef algebra_stepper_base_type::algebra_type boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::algebra_type
template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
typedef Coor boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::coor_type
template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
typedef std::pair< velocity_type , acceleration_type > boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::deriv_type
template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
typedef algebra_stepper_base_type::operations_type boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::operations_type
template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
typedef unsigned short boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::order_type
template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
typedef Resizer boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::resizer_type
template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
typedef std::pair< coor_type , velocity_type > boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::state_type
template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
typedef stepper_tag boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::stepper_category
template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
typedef TimeSq boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::time_square_type
template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
typedef Time boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::time_type
template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
typedef Value boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::value_type
template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
typedef Velocity boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::velocity_type
template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
typedef state_wrapper< acceleration_type > boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::wrapped_acceleration_type

Constructor & Destructor Documentation

template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::velocity_verlet ( const algebra_type algebra = algebra_type())
inline

Constructs the velocity_verlet class.

This constructor can be used as a default constructor if the algebra has a default constructor.

Parameters
algebraA copy of algebra is made and stored.

Member Function Documentation

template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
template<class StateIn >
void boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::adjust_size ( const StateIn &  x)
inline

Adjust the size of all temporaries in the stepper manually.

Parameters
xA state from which the size of the temporaries to be resized is deduced.
template<class Algebra, class Operations>
algebra_type & boost::numeric::odeint::algebra_stepper_base< Algebra, Operations >::algebra ( )
inlineinherited
Returns
A reference to the algebra which is held by this class.
template<class Algebra, class Operations>
const algebra_type & boost::numeric::odeint::algebra_stepper_base< Algebra, Operations >::algebra ( ) const
inlineinherited
Returns
A const reference to the algebra which is held by this class.
template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
template<class System , class StateInOut >
boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::do_step ( System  system,
StateInOut &  x,
time_type  t,
time_type  dt 
)
inline

This method performs one step.

It transforms the result in-place.

It can be used like

pair< coordinates , velocities > state;
stepper.do_step( sys , x , t , dt );
Parameters
systemThe system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the Second Order System concept.
xThe state of the ODE which should be solved. The state is pair of Coor and Velocity.
tThe value of the time, at which the step should be performed.
dtThe step size.
template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
template<class System , class StateInOut >
boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::do_step ( System  system,
const StateInOut &  x,
time_type  t,
time_type  dt 
)
inline

This method performs one step.

It transforms the result in-place.

It can be used like

pair< coordinates , velocities > state;
stepper.do_step( sys , x , t , dt );
Parameters
systemThe system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the Second Order System concept.
xThe state of the ODE which should be solved. The state is pair of Coor and Velocity.
tThe value of the time, at which the step should be performed.
dtThe step size.
template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
template<class System , class CoorIn , class VelocityIn , class AccelerationIn , class CoorOut , class VelocityOut , class AccelerationOut >
boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::do_step ( System  system,
CoorIn const &  qin,
VelocityIn const &  pin,
AccelerationIn const &  ain,
CoorOut &  qout,
VelocityOut &  pout,
AccelerationOut &  aout,
time_type  t,
time_type  dt 
)
inline

This method performs one step.

It transforms the result in-place. Additionally to the other methods the coordinates, velocities and accelerations are passed directly to do_step and they are transformed out-of-place.

It can be used like

coordinates qin , qout;
velocities pin , pout;
accelerations ain, aout;
stepper.do_step( sys , qin , pin , ain , qout , pout , aout , t , dt );
Parameters
systemThe system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the Second Order System concept.
xThe state of the ODE which should be solved. The state is pair of Coor and Velocity.
tThe value of the time, at which the step should be performed.
dtThe step size.

References boost::numeric::odeint::algebra_stepper_base< Algebra, Operations >::m_algebra, template, and boost::detail::type.

template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
template<class AccelerationIn >
boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::initialize ( const AccelerationIn &  qin)
inline

Initializes the internal state of the stepper.

Parameters
derivThe acceleration of x. The next call of do_step expects that the acceleration of x passed to do_step has the value of qin.

References boost::numeric::odeint::detail::_1, boost::bind(), boost::numeric::odeint::copy(), boost::ref(), and template.

template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
template<class System , class CoorIn , class VelocityIn >
boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::initialize ( System  system,
const CoorIn &  qin,
const VelocityIn &  pin,
time_type  t 
)
inline

Initializes the internal state of the stepper.

This method is equivalent to

Acceleration a;
system( qin , pin , a , t );
stepper.initialize( a );
Parameters
systemThe system function for the next calls of do_step.
qinThe current coordinates of the ODE.
pinThe current velocities of the ODE.
tThe current time of the ODE.

References boost::numeric::odeint::detail::_1, boost::bind(), boost::ref(), and template.

template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::is_initialized ( void  ) const
inline
Returns
Returns if the stepper is initialized.
template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
order_type boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::order ( void  ) const
inline
template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::reset ( void  )
inline

Resets the internal state of this stepper.

After calling this method it is safe to use all do_step method without explicitly initializing the stepper.

Member Data Documentation

template<class Algebra, class Operations>
algebra_type boost::numeric::odeint::algebra_stepper_base< Algebra, Operations >::m_algebra
protectedinherited
template<class Coor , class Velocity = Coor, class Value = double, class Acceleration = Coor, class Time = Value, class TimeSq = Time, class Algebra = typename algebra_dispatcher< Coor >::algebra_type, class Operations = typename operations_dispatcher< Coor >::operations_type, class Resizer = initially_resizer>
const order_type boost::numeric::odeint::velocity_verlet< Coor, Velocity, Value, Acceleration, Time, TimeSq, Algebra, Operations, Resizer >::order_value = 1
static

The documentation for this class was generated from the following file: