GR Engine
A physics engine in curved space-time
 All Classes Files Functions Variables
Public Member Functions | List of all members
DPIntegrator Class Reference

Class implementing a Dormand-Prince numerical integrator. More...

#include <dpintegrator.h>

Inheritance diagram for DPIntegrator:
Integrator

Public Member Functions

 DPIntegrator (double maxErr=0.000001, double stepSize=0.01, double minStep=0.0001, double maxStep=0.1)
 Constructor. More...
 
 ~DPIntegrator ()
 Destructor.
 
StateVector next (StateVector state, DiffEq *equation, double step=0.0)
 Function calculating the next state. More...
 
double getMaxErr ()
 Returns the error margin.
 
double getMinStep ()
 Returns the minimal step size.
 
double getMaxStep ()
 Returns the maximal step size.
 
void setMaxErr (double)
 Sets the error margin.
 
void setMinStep (double)
 Sets the minimal step size.
 
void setMaxStep (double)
 Sets the maximal step size.
 
- Public Member Functions inherited from Integrator
 Integrator (double stepSize=0.01)
 Constructor. More...
 
virtual ~Integrator ()
 Virtual destructor.
 
void setStepSize (double)
 Sets the default step size.
 
void resetStepSize ()
 Resets the step size to the value passed to the constructor.
 
double getStepSize ()
 Returns the default step size.
 

Additional Inherited Members

- Protected Attributes inherited from Integrator
double stepSize
 Default step size.
 
double initStepSize
 Step size which was given to the constructor (for resetting purposes)
 

Detailed Description

Class implementing a Dormand-Prince numerical integrator.

The Dormand-Prince method is an adaptive method. After each step the step size is recalculated, so that the error will be just below the predefined error margin. The minimal and maximal step size can also be set.

Constructor & Destructor Documentation

DPIntegrator::DPIntegrator ( double  maxErr = 0.000001,
double  stepSize = 0.01,
double  minStep = 0.0001,
double  maxStep = 0.1 
)

Constructor.

Parameters
maxErrThe error margin - if the error is larger than this margin, the step size is decreased.
stepSizeDefault step size
minStepMinimal step size
maxStepMaximal step size

Member Function Documentation

StateVector DPIntegrator::next ( StateVector  state,
DiffEq equation,
double  step = 0.0 
)
virtual

Function calculating the next state.

Parameters
stateCurrent state
equationThe differential equation to be used
stepStep size. If 0 (default), the default step size is used.

Implements Integrator.


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