Public Member Functions | Public Attributes | Protected Attributes | List of all members
o2scl::astep_base< vec_y_t, vec_dydx_t, vec_yerr_t, func_t > Class Template Referenceabstract

Adaptive stepper [abstract base]. More...

#include <astep.h>

Inheritance diagram for o2scl::astep_base< vec_y_t, vec_dydx_t, vec_yerr_t, func_t >:
o2scl::astep_gsl< vec_y_t, vec_dydx_t, vec_yerr_t, func_t > o2scl::astep_nonadapt< vec_y_t, vec_dydx_t, vec_yerr_t, func_t >

Public Member Functions

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

Public Attributes

int verbose
 Set output level.
 
ode_rkck_gsl< vec_y_t, vec_dydx_t, vec_yerr_t, func_t > def_step
 The default stepper.
 

Protected Attributes

ode_step< vec_y_t, vec_dydx_t, vec_yerr_t, func_t > * stepp
 Pointer to the stepper being used.
 

Detailed Description

template<class vec_y_t = boost::numeric::ublas::vector<double>, class vec_dydx_t = vec_y_t, class vec_yerr_t = vec_y_t, class func_t = ode_funct11>
class o2scl::astep_base< vec_y_t, vec_dydx_t, vec_yerr_t, func_t >

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

Definition at line 49 of file astep.h.

Member Function Documentation

◆ astep()

template<class vec_y_t = boost::numeric::ublas::vector<double>, class vec_dydx_t = vec_y_t, class vec_yerr_t = vec_y_t, class func_t = ode_funct11>
virtual int o2scl::astep_base< vec_y_t, vec_dydx_t, vec_yerr_t, func_t >::astep ( double &  x,
double  xlimit,
double &  h,
size_t  n,
vec_y_t &  y,
vec_dydx_t &  dydx_out,
vec_yerr_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 o2scl::astep_gsl< vec_y_t, vec_dydx_t, vec_yerr_t, func_t >, o2scl::astep_gsl< vec_t, vec_t, vec_t, func_t >, and o2scl::astep_nonadapt< vec_y_t, vec_dydx_t, vec_yerr_t, func_t >.

◆ astep_derivs()

template<class vec_y_t = boost::numeric::ublas::vector<double>, class vec_dydx_t = vec_y_t, class vec_yerr_t = vec_y_t, class func_t = ode_funct11>
virtual int o2scl::astep_base< vec_y_t, vec_dydx_t, vec_yerr_t, func_t >::astep_derivs ( double &  x,
double  xlimit,
double &  h,
size_t  n,
vec_y_t &  y,
vec_dydx_t &  dydx,
vec_yerr_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 o2scl::astep_gsl< vec_y_t, vec_dydx_t, vec_yerr_t, func_t >, o2scl::astep_gsl< vec_t, vec_t, vec_t, func_t >, and o2scl::astep_nonadapt< vec_y_t, vec_dydx_t, vec_yerr_t, func_t >.

◆ astep_full()

template<class vec_y_t = boost::numeric::ublas::vector<double>, class vec_dydx_t = vec_y_t, class vec_yerr_t = vec_y_t, class func_t = ode_funct11>
virtual int o2scl::astep_base< vec_y_t, vec_dydx_t, vec_yerr_t, func_t >::astep_full ( double  x,
double  xlimit,
double &  x_out,
double &  h,
size_t  n,
vec_y_t &  y,
vec_dydx_t &  dydx,
vec_y_t &  yout,
vec_yerr_t &  yerr,
vec_dydx_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 o2scl::astep_gsl< vec_y_t, vec_dydx_t, vec_yerr_t, func_t >, o2scl::astep_gsl< vec_t, vec_t, vec_t, func_t >, and o2scl::astep_nonadapt< vec_y_t, vec_dydx_t, vec_yerr_t, func_t >.

◆ set_step()

template<class vec_y_t = boost::numeric::ublas::vector<double>, class vec_dydx_t = vec_y_t, class vec_yerr_t = vec_y_t, class func_t = ode_funct11>
int o2scl::astep_base< vec_y_t, vec_dydx_t, vec_yerr_t, func_t >::set_step ( ode_step< vec_y_t, vec_dydx_t, vec_yerr_t, func_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 ode_rkck_gsl) is used.

Definition at line 118 of file astep.h.


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

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