Class astep_nonadapt (o2scl)¶
-
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_funct, class fp_t = double>
class astep_nonadapt : public o2scl::astep_base<boost::numeric::ublas::vector<double>, boost::numeric::ublas::vector<double>, boost::numeric::ublas::vector<double>, ode_funct, double>¶ An non-adaptive stepper implementation of astep_base.
This class simply calls the specified ODE stepper without any attempt to modify the size of the step. It is primarily useful to allow for simple comparisons between adaptive and non-adaptive solution or to proceed with a solution in places where an adaptive stepper is failing.
To modify the ODE stepper which is used, use the function astep_base::set_step().
Public Functions
-
inline astep_nonadapt()¶
-
inline virtual ~astep_nonadapt()¶
-
inline virtual int astep(fp_t &x, fp_t xlimit, fp_t &h, size_t n, vec_y_t &y, vec_dydx_t &dydx_out, vec_yerr_t &yerr, func_t &derivs)¶
Make an adaptive integration step of the system
derivs
.This attempts to take a step of size
h
from the pointx
of ann-dimensional
systemderivs
starting withy
. On exit,x
andy
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, andyerr
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 inputy
may still have been modified by the base stepper.
-
inline virtual int astep_derivs(fp_t &x, fp_t xlimit, fp_t &h, size_t n, vec_y_t &y, vec_dydx_t &dydx, vec_yerr_t &yerr, func_t &derivs)¶
Make an adaptive integration step of the system
derivs
with derivatives.This attempts to take a step of size
h
from the pointx
of ann-dimensional
systemderivs
starting withy
and given the initial derivativesdydx
. On exit,x
,y
anddydx
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, andyerr
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 inputsy
anddydx
may still have been modified by the base stepper.
-
inline virtual int astep_full(fp_t x, fp_t xlimit, fp_t &x_out, fp_t &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)¶
Make an adaptive integration step of the system
derivs
.This function performs an adaptive integration step with the
n-dimensional
systemderivs
and parameterpa
. It Begins atx
with initial stepsizeh
, ensuring that the step goes no farther thanxlimit
. At the end of the step, the size of the step taken ish
and the new value ofx
is inx_out
. Initially, the function values and derivatives should be specified iny
anddydx
. The function values, derivatives, and the error at the end of the step are given inyout
,yerr
, anddydx_out
. Unlike inode_step
objects, the objectsy
,yout
,dydx
, anddydx_out
must all be distinct.If the base stepper returns a non-zero value, that value is passed on as the return value of
astep()
, though the output parameters may still have been modified by the base stepper.
Protected Attributes
-
size_t msize¶
The allocated vector size.
-
vec_dydx_t dydx_int¶
Internal storage for dydx.
-
inline astep_nonadapt()¶