1#ifndef SPHERICALCOLLAPSEMODEL
2#define SPHERICALCOLLAPSEMODEL
11 namespace SPHERICALCOLLAPSE {
14 using Func1 = std::function<double(
double)>;
72 [[maybe_unused]]
double delta_prime,
73 [[maybe_unused]]
double roverR,
74 [[maybe_unused]]
double x)
const;
98 const double mu =
muofx(
x);
101 const double delta =
y[0];
102 const double ddeltadx =
y[1];
106 dydx[1] = -(2.0+dlogEdloga)*ddeltadx + 1.5*om*mu*delta;
119 const double mu =
muofx(
x);
122 const double delta =
y[0];
123 const double ddeltadx =
y[1];
124 const double delta_lin =
y[2];
125 const double ddeltadx_lin =
y[3];
129 dydx[1] = -(2.0+dlogEdloga)*ddeltadx + 1.5*om*mu*delta*(1+delta) + 4.0/3.0*ddeltadx*ddeltadx/(1.0+delta);
132 dydx[2] = ddeltadx_lin;
133 dydx[3] = -(2.0+dlogEdloga)*ddeltadx_lin + 1.5*om*mu*delta_lin;
147 [&]([[maybe_unused]]
double x){
return 1.0; };
149 [&]([[maybe_unused]]
double x){
return -1.0; };
FML::SOLVERS::ODESOLVER::ODEFunction ODEFunction
The class contains all the info about the model needed to run the spherical collapse and halomodel Co...
void info() const
Print useful info.
double virial_condition(double delta, double delta_prime, double roverR, double x) const
Virial condition.
SphericalCollapseModel(Func1 Eofx, Func1 OmegaMofx, Func1 logEprimeofx, Func1 muofx, Func1 wofx)
void set_model_lcdm()
Set the model to be lcdm.
int ode_system_non_linear_growth(double x, const double *y, double *dydx) const
Define the non-linear + linear ODE system for spherical collapse 0 = delta 1 = ddeltadloga 2 = delta_...
int ode_system_linear_growth(double x, const double *y, double *dydx) const
Define the linear ODE system 0 = delta_lin 1 = ddeltadloga_lin.
double nonlinear_condition(double delta, double delta_prime, double roverR, double x) const
Define the non-linear time when this quantity is zero Using delta-1 = 0.
std::function< double(double)> Func1
std::function< int(double, const double *, double *)> ODEFunction