Object-oriented Scientific Computing Library: Version 0.910
Public Member Functions | Data Fields | Protected Attributes
adapt_step< func_t, vec_t, alloc_vec_t, alloc_t > Class Template Reference

Adaptive stepper [abstract base]. More...

#include <adapt_step.h>

Inheritance diagram for adapt_step< func_t, vec_t, alloc_vec_t, alloc_t >:
gsl_astep< func_t, vec_t, alloc_vec_t, alloc_t > gsl_astep_old< func_t, vec_t, alloc_vec_t, alloc_t > nonadapt_step< func_t, vec_t, alloc_vec_t, alloc_t >

Detailed Description

template<class func_t = ode_funct<>, class vec_t = ovector_base, class alloc_vec_t = ovector, class alloc_t = ovector_alloc>
class adapt_step< func_t, vec_t, alloc_vec_t, alloc_t >

The adaptive stepper routines are based on one or many applications of ordinary ODE steppers (implemented in ode_step). Each adaptive stepper (gsl_astep or nonadapt_step) can be used with any of the ODE stepper classes (e.g. gsl_rkck). By default, gsl_rkck is used. To modify the ODE stepper which is used, use the member function set_step() documented below.

Note:
If you use gsl_rkck_fast or gsl_rk8pd_fast, you'll need to make sure that the argument n to astep() or astep_derivs() below matches the template size parameter given in the ODE stepper.

Definition at line 51 of file adapt_step.h.

Public Member Functions

virtual int astep (double &x, double xlimit, double &h, size_t n, vec_t &y, vec_t &dydx_out, vec_t &yerr, func_t &derivs)=0
 Make an adaptive integration step of the system derivs.
virtual int astep_derivs (double &x, double xlimit, double &h, size_t n, vec_t &y, vec_t &dydx, vec_t &yerr, func_t &derivs)=0
 Make an adaptive integration step of the system derivs with derivatives.
virtual int astep_full (double x, double xlimit, double &x_out, double &h, size_t n, vec_t &y, vec_t &dydx, vec_t &yout, vec_t &yerr, vec_t &dydx_out, func_t &derivs)=0
 Make an adaptive integration step of the system derivs with derivatives.
int set_step (ode_step< func_t, vec_t > &step)
 Set stepper.

Data Fields

int verbose
 Set output level.
gsl_rkck< func_t, vec_t,
alloc_vec_t, alloc_t > 
def_step
 The default stepper.

Protected Attributes

ode_step< func_t, vec_t > * stepp
 Pointer to the stepper being used.

Member Function Documentation

template<class func_t = ode_funct<>, class vec_t = ovector_base, class alloc_vec_t = ovector, class alloc_t = ovector_alloc>
virtual int adapt_step< func_t, vec_t, alloc_vec_t, alloc_t >::astep ( double &  x,
double  xlimit,
double &  h,
size_t  n,
vec_t &  y,
vec_t &  dydx_out,
vec_t &  yerr,
func_t &  derivs 
) [pure virtual]

This attempts to take a step of size h from the point x of an n-dimensional system derivs starting with y. On exit, x and y contain the new values at the end of the step, h contains the size of the step, dydx_out contains the derivative at the end of the step, and yerr contains the estimated error at the end of the step.

Implemented in gsl_astep< func_t, vec_t, alloc_vec_t, alloc_t >, gsl_astep_old< func_t, vec_t, alloc_vec_t, alloc_t >, and nonadapt_step< func_t, vec_t, alloc_vec_t, alloc_t >.

template<class func_t = ode_funct<>, class vec_t = ovector_base, class alloc_vec_t = ovector, class alloc_t = ovector_alloc>
virtual int adapt_step< func_t, vec_t, alloc_vec_t, alloc_t >::astep_derivs ( double &  x,
double  xlimit,
double &  h,
size_t  n,
vec_t &  y,
vec_t &  dydx,
vec_t &  yerr,
func_t &  derivs 
) [pure virtual]

This attempts to take a step of size h from the point x of an n-dimensional system derivs starting with y and given the initial derivatives dydx. On exit, x, y and dydx contain the new values at the end of the step, h contains the size of the step, dydx contains the derivative at the end of the step, and yerr contains the estimated error at the end of the step.

Implemented in gsl_astep< func_t, vec_t, alloc_vec_t, alloc_t >, gsl_astep_old< func_t, vec_t, alloc_vec_t, alloc_t >, and nonadapt_step< func_t, vec_t, alloc_vec_t, alloc_t >.

template<class func_t = ode_funct<>, class vec_t = ovector_base, class alloc_vec_t = ovector, class alloc_t = ovector_alloc>
virtual int adapt_step< func_t, vec_t, alloc_vec_t, alloc_t >::astep_full ( double  x,
double  xlimit,
double &  x_out,
double &  h,
size_t  n,
vec_t &  y,
vec_t &  dydx,
vec_t &  yout,
vec_t &  yerr,
vec_t &  dydx_out,
func_t &  derivs 
) [pure virtual]

This function performs an adaptive integration step with the n-dimensional system derivs and parameter pa. It Begins at x with initial stepsize h, ensuring that the step goes no farther than xlimit. At the end of the step, the size of the step taken is h and the new value of x is in x_out. Initially, the function values and derivatives should be specified in y and dydx. The function values, derivatives, and the error at the end of the step are given in yout, yerr, and dydx_out. Unlike in ode_step objects, the objects y, yout, dydx, and dydx_out must all be distinct.

Implemented in gsl_astep< func_t, vec_t, alloc_vec_t, alloc_t >, gsl_astep_old< func_t, vec_t, alloc_vec_t, alloc_t >, and nonadapt_step< func_t, vec_t, alloc_vec_t, alloc_t >.

template<class func_t = ode_funct<>, class vec_t = ovector_base, class alloc_vec_t = ovector, class alloc_t = ovector_alloc>
int adapt_step< func_t, vec_t, alloc_vec_t, alloc_t >::set_step ( ode_step< func_t, vec_t > &  step) [inline]

This sets the stepper for use in the adaptive step routine. If no stepper is specified, then the default (def_step of type gsl_rkck) is used.

Definition at line 120 of file adapt_step.h.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).

Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads.