15 c3 = 1.0/2; a31 = 1.0/4; a32 = 1.0/4;
16 b1 = 1.0/6; b2 = 1.0/6; b3 = 2.0/3;
19void OdeSsp3::step_ (
double dt) {
36 for (i=0; i<
neq_; i++)
sol_[i] += dt*(b1*
k_[0][i] + b2*
k_[1][i] + b3*
k_[2][i]);
Base class implementing solver functions with adaptive time steps.
unsigned long neq_
number of equations in the system of ODEs
std::string method_
the "name" of the solver/method, as in "Euler" or "RK4"
double * sol_
array for the solution, changing over time
void ode_fun_(double *solin, double *fout)
wrapper, calls ode_fun() and increases the neval counter by one
Base class providing space for temporary solutions moving through RK stages.
double * soltemp_
temporary solution vector
Provides space for stage slope values, an array of arrays for k values.
double ** k_
stage evaluations
OdeSsp3(unsigned long neq)
constructs