nonadapt_step Class Template Reference

An non-adaptive stepper implementation of adapt_step. More...

#include <nonadapt_step.h>

Inheritance diagram for nonadapt_step:

adapt_step

Detailed Description

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

An non-adaptive stepper implementation of adapt_step.

This class simply calls the specified ODE stepper without any attempt to modify the size of the step, and is primarily useful to allow for simple comparisons between adaptive and non-adaptive solution. To modify the ODE stepper which is used, use the adapt_step::set_step().

Idea for future:
Modify so that memory allocation/deallocation is only performed when necessary

Definition at line 49 of file nonadapt_step.h.


Public Member Functions

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

Protected Attributes

size_t msize
 The allocated vector size.
alloc_vec_t dydx_int
 Internal storage for dydx.
alloc_t ao
 Memory allocator for objects of type alloc_vec_t.

Member Function Documentation

virtual int astep ( double &  x,
double &  h,
double  xmax,
size_t  n,
vec_t &  y,
vec_t &  u_dydx_out,
vec_t &  yerr,
param_t &  pa,
func_t &  derivs 
) [inline, virtual]

Make an adaptive integration step of the system derivs.

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 base stepper returns a non-zero value, that value is passed on as the return value of astep(), though the input y may still have been modified by the base stepper.

Implements adapt_step.

Definition at line 103 of file nonadapt_step.h.

virtual int astep_derivs ( double &  x,
double &  h,
double  xmax,
size_t  n,
vec_t &  y,
vec_t &  dydx,
vec_t &  yerr,
param_t &  pa,
func_t &  derivs 
) [inline, virtual]

Make an adaptive integration step of the system derivs with derivatives.

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, that value is passed on as the return value of astep(), though the inputs y and dydx may still have been modified by the base stepper.

Implements adapt_step.

Definition at line 138 of file nonadapt_step.h.


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

Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page