Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
anonymous_namespace{core_power.cpp}::ODE_Solver Class Reference

: Explicit embedded Runge-Kutta Prince-Dormand (8, 9) method. More...

Public Member Functions

 ODE_Solver (int(*function)(double t, const double y[], double dydt[], void *params), size_t dim, void *params, const double hstart=1e-6, const double epsabs=1e-6, const double epsrel=0)
 
 ~ODE_Solver ()
 
void update (double &t, const double t1, double y[])
 

Public Attributes

int status
 
gsl_odeiv2_system sys
 
gsl_odeiv2_driver * d
 

Detailed Description

: Explicit embedded Runge-Kutta Prince-Dormand (8, 9) method.

Definition at line 214 of file core_power.cpp.

Constructor & Destructor Documentation

anonymous_namespace{core_power.cpp}::ODE_Solver::ODE_Solver ( int(*)(double t, const double y[], double dydt[], void *params)  function,
size_t  dim,
void *  params,
const double  hstart = 1e-6,
const double  epsabs = 1e-6,
const double  epsrel = 0 
)
inline

Definition at line 217 of file core_power.cpp.

218  :
219  sys({function, NULL, dim, params}),
220  d(gsl_odeiv2_driver_alloc_y_new(&sys, gsl_odeiv2_step_rk8pd, hstart, epsabs, epsrel)) {}
dictionary params
Definition: halomod_bm.py:27
anonymous_namespace{core_power.cpp}::ODE_Solver::~ODE_Solver ( )
inline

Definition at line 222 of file core_power.cpp.

223  {
224  gsl_odeiv2_driver_free (d);
225  }

Member Function Documentation

void anonymous_namespace{core_power.cpp}::ODE_Solver::update ( double t,
const double  t1,
double  y[] 
)
inline

Definition at line 227 of file core_power.cpp.

228  {
229  status = gsl_odeiv2_driver_apply (d, &t, t1, y);
230  if (status) throw std::runtime_error("GSL ODE error: " + std::string(gsl_strerror(status)));
231  }

Member Data Documentation

gsl_odeiv2_driver* anonymous_namespace{core_power.cpp}::ODE_Solver::d

Definition at line 235 of file core_power.cpp.

int anonymous_namespace{core_power.cpp}::ODE_Solver::status

Definition at line 233 of file core_power.cpp.

gsl_odeiv2_system anonymous_namespace{core_power.cpp}::ODE_Solver::sys

Definition at line 234 of file core_power.cpp.


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