Documentation


animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT > Struct Template Reference

#include <explicit_solver.h>

Inheritance diagram for animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >:

animal::integration::Solver< DerivativeF, StepF, TraitsT > List of all members.

Detailed Description

template<class DerivativeF, class StepF, class TraitsT>
struct animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >

Explicit fourth-order Runge-Kutta integration method.

Fourth-order accurate method. The performed step is a linear combination of derivatives computed at different points.

Author:
David Bourguignon, iMAGIS-GRAVIR, March 2000, animal/integration/explicit_solver.h
See also:
Solver

Solver_Traits

Definition at line 284 of file explicit_solver.h.

Protected

void setSize (const SizeType size)
 Resize auxiliary containers.

CopyState tmp_S
 Temporary state value.

Derivative D2
 Derivative first, second, third and fourth evaluations.

Derivative D3
 Derivative first, second, third and fourth evaluations.

Derivative D4
 Derivative first, second, third and fourth evaluations.

Derivative final_D
 Final derivative value.


Public Types

typedef TraitsT Traits
 Traits class: includes all type definitions.

typedef Traits::Real Real
 Floating-point value for time.

typedef Traits::State State
 Container of state variables.

typedef Traits::CopyState CopyState
 Container of copies of state variables.

typedef Traits::Derivative Derivative
 Container of derivative variables.

typedef Traits::SizeType SizeType
 Natural number to define container size, typically unsigned int.


Public Member Functions

Constructor
Default constructor is typically used, unless the lower-level objects include special data.

 Runge_Kutta_4 (const DerivativeF &df=DerivativeF(), const StepF &sf=StepF(), const Traits &tr=Traits())
 Just calls the base class constructor.

virtual ~Runge_Kutta_4 ()
 Destructor does nothing.

Integration scheme
Implementation of the numerical integration method.

void doStep (const State &initial_S, State &final_S, const Derivative &initial_D, const Real t, const Real h)
 Given a state initial_S and a derivative initial_D at time t, integrate over a time step h and write the result in final_S.


Member Typedef Documentation

template<class DerivativeF, class StepF, class TraitsT>
typedef Traits::CopyState animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::CopyState
 

Container of copies of state variables.

Reimplemented from animal::integration::Solver< DerivativeF, StepF, TraitsT >.

Definition at line 297 of file explicit_solver.h.

template<class DerivativeF, class StepF, class TraitsT>
typedef Traits::Derivative animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::Derivative
 

Container of derivative variables.

Reimplemented from animal::integration::Solver< DerivativeF, StepF, TraitsT >.

Definition at line 300 of file explicit_solver.h.

template<class DerivativeF, class StepF, class TraitsT>
typedef Traits::Real animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::Real
 

Floating-point value for time.

Reimplemented from animal::integration::Solver< DerivativeF, StepF, TraitsT >.

Definition at line 291 of file explicit_solver.h.

template<class DerivativeF, class StepF, class TraitsT>
typedef Traits::SizeType animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::SizeType
 

Natural number to define container size, typically unsigned int.

Reimplemented from animal::integration::Solver< DerivativeF, StepF, TraitsT >.

Definition at line 303 of file explicit_solver.h.

template<class DerivativeF, class StepF, class TraitsT>
typedef Traits::State animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::State
 

Container of state variables.

Reimplemented from animal::integration::Solver< DerivativeF, StepF, TraitsT >.

Definition at line 294 of file explicit_solver.h.

template<class DerivativeF, class StepF, class TraitsT>
typedef TraitsT animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::Traits
 

Traits class: includes all type definitions.

Reimplemented from animal::integration::Solver< DerivativeF, StepF, TraitsT >.

Definition at line 288 of file explicit_solver.h.


Constructor & Destructor Documentation

template<class DerivativeF, class StepF, class TraitsT>
animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::Runge_Kutta_4 const DerivativeF &  df = DerivativeF(),
const StepF &  sf = StepF(),
const Traits tr = Traits()
[inline]
 

Just calls the base class constructor.

Definition at line 315 of file explicit_solver.h.

template<class DerivativeF, class StepF, class TraitsT>
virtual animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::~Runge_Kutta_4  )  [inline, virtual]
 

Destructor does nothing.

Definition at line 324 of file explicit_solver.h.


Member Function Documentation

template<class DerivativeF, class StepF, class TraitsT>
void animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::doStep const State initial_S,
State final_S,
const Derivative initial_D,
const Real  t,
const Real  h
[inline, virtual]
 

Given a state initial_S and a derivative initial_D at time t, integrate over a time step h and write the result in final_S.

This method is typically called indirectly by the operator () of the base class Solver, but it may be called directly if the derivative at the beginning of the time step is known.

Implements animal::integration::Solver< DerivativeF, StepF, TraitsT >.

Definition at line 343 of file explicit_solver.h.

References animal::integration::Solver< DerivativeF, StepF, TraitsT >::applyStep, animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::D2, animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::D3, animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::D4, animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::final_D, and animal::integration::Solver< DerivativeF, StepF, TraitsT >::writeDerivative.

template<class DerivativeF, class StepF, class TraitsT>
void animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::setSize const SizeType  size  )  [inline, protected, virtual]
 

Resize auxiliary containers.

Implements animal::integration::Solver< DerivativeF, StepF, TraitsT >.

Definition at line 387 of file explicit_solver.h.

References animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::D2, animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::D3, animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::D4, and animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::final_D.


Member Data Documentation

template<class DerivativeF, class StepF, class TraitsT>
Derivative animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::D2 [protected]
 

Derivative first, second, third and fourth evaluations.

Definition at line 381 of file explicit_solver.h.

Referenced by animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::doStep(), and animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::setSize().

template<class DerivativeF, class StepF, class TraitsT>
Derivative animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::D3 [protected]
 

Derivative first, second, third and fourth evaluations.

Definition at line 381 of file explicit_solver.h.

Referenced by animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::doStep(), and animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::setSize().

template<class DerivativeF, class StepF, class TraitsT>
Derivative animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::D4 [protected]
 

Derivative first, second, third and fourth evaluations.

Definition at line 381 of file explicit_solver.h.

Referenced by animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::doStep(), and animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::setSize().

template<class DerivativeF, class StepF, class TraitsT>
Derivative animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::final_D [protected]
 

Final derivative value.

Definition at line 384 of file explicit_solver.h.

Referenced by animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::doStep(), and animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::setSize().

template<class DerivativeF, class StepF, class TraitsT>
CopyState animal::integration::Runge_Kutta_4< DerivativeF, StepF, TraitsT >::tmp_S [protected]
 

Temporary state value.

Definition at line 378 of file explicit_solver.h.


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