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

Adaptive ODE stepper (GSL) More...

#include <gsl_astep_old.h>

Inheritance diagram for gsl_astep_old< func_t, vec_t, alloc_vec_t, alloc_t >:
adapt_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 gsl_astep_old< func_t, vec_t, alloc_vec_t, alloc_t >

[This is the stepper from O2scl version 0.908 which is kept around for diagnostic purposes and some legacy code.]

This class performs an adaptive step of a system of ODEs. To modify the ODE stepper which is used, use the function adapt_step::set_step().

There is an example for the usage of this class in examples/ex_ode.cpp documented in the Ordinary differential equations section.

Default template arguments

Definition at line 78 of file gsl_astep_old.h.

Public Member Functions

virtual int astep_derivs (double &x, double xmax, double &h, size_t n, vec_t &y, vec_t &dydx, vec_t &yerr, func_t &derivs)
 Make an adaptive integration step of the system derivs with derivatives.
virtual int astep_full (double x, double xmax, double &x_out, double &h, size_t n, vec_t &y, vec_t &dydx, vec_t &yout2, vec_t &yerr, vec_t &dydx_out, func_t &derivs)
 Make an adaptive integration step of the system derivs.
virtual int astep (double &x, double xmax, double &h, size_t n, vec_t &y, vec_t &dydx_out, vec_t &yerr, func_t &derivs)
 Make an adaptive integration step of the system derivs.

Data Fields

gsl_ode_control< vec_t > con
 Control specification.

Protected Member Functions

int evolve_apply (double t0, double &t, double &h, double t1, size_t nvar, vec_t &y, vec_t &dydx, vec_t &yout2, vec_t &yerr, vec_t &dydx_out2, func_t &derivs)
 Apply the evolution for the next adaptive step.

Protected Attributes

alloc_t ao
 Memory allocator for objects of type alloc_vec_t.
alloc_vec_t yout
 Temporary storage for yout.
alloc_vec_t dydx_int
 Internal storage for dydx.
double last_step
 The size of the last step.
unsigned long int count
 The number of steps.
unsigned long int failed_steps
 The number of failed steps.
size_t msize
 The size of the allocated vectors.

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 gsl_astep_old< func_t, vec_t, alloc_vec_t, alloc_t >::astep_derivs ( double &  x,
double  xmax,
double &  h,
size_t  n,
vec_t &  y,
vec_t &  dydx,
vec_t &  yerr,
func_t &  derivs 
) [inline, 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.

If the base stepper returns a non-zero value, the step is aborted and y is unmodified. The error handler is never called.

Implements adapt_step< func_t, vec_t, alloc_vec_t, alloc_t >.

Definition at line 209 of file gsl_astep_old.h.

template<class func_t = ode_funct<>, class vec_t = ovector_base, class alloc_vec_t = ovector, class alloc_t = ovector_alloc>
virtual int gsl_astep_old< func_t, vec_t, alloc_vec_t, alloc_t >::astep_full ( double  x,
double  xmax,
double &  x_out,
double &  h,
size_t  n,
vec_t &  y,
vec_t &  dydx,
vec_t &  yout2,
vec_t &  yerr,
vec_t &  dydx_out,
func_t &  derivs 
) [inline, 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 xmax. 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.

If the base stepper returns a non-zero value, the step is aborted. The error handler is never called.

This adaptive stepper function is faster than astep() or astep_derivs() because it does not require any copying of vectors.

Implements adapt_step< func_t, vec_t, alloc_vec_t, alloc_t >.

Definition at line 263 of file gsl_astep_old.h.

template<class func_t = ode_funct<>, class vec_t = ovector_base, class alloc_vec_t = ovector, class alloc_t = ovector_alloc>
virtual int gsl_astep_old< func_t, vec_t, alloc_vec_t, alloc_t >::astep ( double &  x,
double  xmax,
double &  h,
size_t  n,
vec_t &  y,
vec_t &  dydx_out,
vec_t &  yerr,
func_t &  derivs 
) [inline, 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.

If the system derivs or the base stepper return a non-zero value, the adaptive step is aborted and y is unmodified. The error handler is never called.

Implements adapt_step< func_t, vec_t, alloc_vec_t, alloc_t >.

Definition at line 298 of file gsl_astep_old.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.