Documentation


animal::ExplicitIntegrator< State, Deriv, Derivator, Real > Class Template Reference

#include <integrator.h>

List of all members.


Detailed Description

template<class State, class Deriv, class Derivator, class Real>
class animal::ExplicitIntegrator< State, Deriv, Derivator, Real >

Apply explicit time integration of a given function.

Suitable for first-order systems: derivative(value) Handles auxiliary variables and their resizing. Template parameters:

/@ sa ExplicitIntegrator2

Definition at line 146 of file integrator.h.

Public Member Functions

 ExplicitIntegrator (Derivator *d=0)
 Construct using the derivator.

template<class States> void euler (States &s, Real h, Real t=0)
 Apply euler time integration.

template<class States> void rk2 (States &s, Real h, Real t=0)
 Apply second-order Runge-Kutta time integration.

template<class States> void rk4 (States &s, Real h, Real t=0)
 Apply fourth-order Runge-Kutta time integration.

template<class States> void modmid (States &s, Real h, int n, Real t=0)
 Apply modified midpoint time integration.


Protected Attributes

animal::vector< Deriv > d1
 Auxiliary value to store a derivative.

animal::vector< Deriv > d2
 Auxiliary value to store a derivative.

animal::vector< Deriv > d3
 Auxiliary value to store a derivative.

animal::vector< Deriv > d4
 Auxiliary value to store a derivative.

animal::vector< State > s1
 Auxiliary value to store a state.

animal::vector< State > s2
 Auxiliary value to store a state.

animal::vector< State > s3
 Auxiliary value to store a state.


Private Attributes

Derivator * eq_deriv
 A functor which computes the time derivative of a given state.


Constructor & Destructor Documentation

template<class State, class Deriv, class Derivator, class Real>
animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::ExplicitIntegrator Derivator *  d = 0  )  [inline]
 

Construct using the derivator.

Definition at line 152 of file integrator.h.

References animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::eq_deriv.


Member Function Documentation

template<class State, class Deriv, class Derivator, class Real>
template<class States>
void animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::euler States s,
Real  h,
Real  t = 0
[inline]
 

Apply euler time integration.

Class States is a container with entry type equal or compatible with State.

Parameters:
s current state
h time step
t current time

Definition at line 162 of file integrator.h.

References animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::d1, animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::eq_deriv, animal::integrate_euler(), and animal::size().

template<class State, class Deriv, class Derivator, class Real>
template<class States>
void animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::modmid States s,
Real  h,
int  n,
Real  t = 0
[inline]
 

Apply modified midpoint time integration.

Class States is a container with entry type equal or compatible with State.

Parameters:
s current state
h time step
n number of substeps
t current time

Definition at line 207 of file integrator.h.

References animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::d1, animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::eq_deriv, animal::integrate_modmid(), animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::s1, animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::s2, animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::s3, and animal::size().

template<class State, class Deriv, class Derivator, class Real>
template<class States>
void animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::rk2 States s,
Real  h,
Real  t = 0
[inline]
 

Apply second-order Runge-Kutta time integration.

Class States is a container with entry type equal or compatible with State.

Parameters:
s current state
h time step
t current time

Definition at line 175 of file integrator.h.

References animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::d1, animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::eq_deriv, animal::integrate_rk2(), animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::s1, and animal::size().

template<class State, class Deriv, class Derivator, class Real>
template<class States>
void animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::rk4 States s,
Real  h,
Real  t = 0
[inline]
 

Apply fourth-order Runge-Kutta time integration.

Class States is a container with entry type equal or compatible with State.

Parameters:
s current state
h time step
t current time

Definition at line 189 of file integrator.h.

References animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::d1, animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::d2, animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::d3, animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::d4, animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::eq_deriv, animal::integrate_rk4(), animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::s1, and animal::size().


Member Data Documentation

template<class State, class Deriv, class Derivator, class Real>
animal::vector<Deriv> animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::d1 [protected]
 

Auxiliary value to store a derivative.

Definition at line 218 of file integrator.h.

Referenced by animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::euler(), animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::modmid(), animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::rk2(), and animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::rk4().

template<class State, class Deriv, class Derivator, class Real>
animal::vector<Deriv> animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::d2 [protected]
 

Auxiliary value to store a derivative.

Definition at line 219 of file integrator.h.

Referenced by animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::rk4().

template<class State, class Deriv, class Derivator, class Real>
animal::vector<Deriv> animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::d3 [protected]
 

Auxiliary value to store a derivative.

Definition at line 220 of file integrator.h.

Referenced by animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::rk4().

template<class State, class Deriv, class Derivator, class Real>
animal::vector<Deriv> animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::d4 [protected]
 

Auxiliary value to store a derivative.

Definition at line 221 of file integrator.h.

Referenced by animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::rk4().

template<class State, class Deriv, class Derivator, class Real>
Derivator* animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::eq_deriv [private]
 

A functor which computes the time derivative of a given state.

Definition at line 149 of file integrator.h.

Referenced by animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::euler(), animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::ExplicitIntegrator(), animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::modmid(), animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::rk2(), and animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::rk4().

template<class State, class Deriv, class Derivator, class Real>
animal::vector<State> animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::s1 [protected]
 

Auxiliary value to store a state.

Definition at line 222 of file integrator.h.

Referenced by animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::modmid(), animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::rk2(), and animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::rk4().

template<class State, class Deriv, class Derivator, class Real>
animal::vector<State> animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::s2 [protected]
 

Auxiliary value to store a state.

Definition at line 223 of file integrator.h.

Referenced by animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::modmid().

template<class State, class Deriv, class Derivator, class Real>
animal::vector<State> animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::s3 [protected]
 

Auxiliary value to store a state.

Definition at line 224 of file integrator.h.

Referenced by animal::ExplicitIntegrator< State, Deriv, Derivator, Real >::modmid().


The documentation for this class was generated from the following file:
Generated on Thu Dec 23 13:52:30 2004 by doxygen 1.3.6