42 std::vector<double>
cbl::wrapper::camb::Pk_CAMB (
const bool nonlinear,
const double redshift,
const double kmin,
const double kmax,
const int npoints,
const double ombh2,
const double omch2,
const double omnuh2,
const double massless_nu,
const int massive_nu,
const double omk,
const double H0,
const double ns,
const double As,
const double pivot_scalar,
const double w,
const double wa,
const double tau,
const bool accurate_massive_nu,
const int neutrino_hierarchy,
const int dark_energy_model,
const double cs2_lam,
const double T_cmb,
const double helium_fraction)
46 ErrorCBL(
"the minimum k must be > 5.e-5.",
"Pk_CAMB",
"CAMB.cpp");
52 SetCAMBparams(params, ombh2, omch2, omnuh2, massless_nu, massive_nu, neutrino_hierarchy, omk, H0, dark_energy_model, w, wa, tau, cs2_lam, T_cmb, helium_fraction);
53 SetCAMBPk(params, redshift, ns, As, pivot_scalar, accurate_massive_nu, kmax, nonlinear);
58 std::vector<double> Pk (npoints, 0.);
59 const double h = (H0/100.);
60 const double minkh = kmin/h;
61 const double dlnkh = (log(kmax/h)-log(minkh)) / (npoints-1);
63 GetCAMBPk(data, Pk.data(), minkh, dlnkh, npoints);
class CAMB that wrap CAMB routines
std::vector< double > Pk_CAMB(const bool nonlinear, const double redshift, const double kmin, const double kmax, const int npoints, const double ombh2, const double omch2, const double omnuh2, const double massless_nu, const int massive_nu, const double omk, const double H0, const double ns, const double As, const double pivot_scalar=0.05, const double w=-1., const double wa=0., const double tau=2.1e-9, const bool accurate_massive_nu=false, const int neutrino_hierarchy=3, const int dark_energy_model=1, const double cs2_lam=1., const double T_cmb=2.7255, const double helium_fraction=0.24)
Get the matter power spectrum from CAMB.
void * ReleaseCAMBdata(void *data)
wrapper of the subroutine ReleaseCAMBdata in CAMB/CAMBinterface.f90, deallocating CAMBdata instance
void * ReleaseCAMBparams(void *params)
wrapper of the subroutine ReleaseCAMBparams in CAMB/CAMBinterface.f90, deallocating CAMBparams instan...
void GetCAMBPk(void *data, double *Pk, const double mink, const double dlnkh, const int npoints)
wrapper of the subroutine GetCAMBPk in CAMB/CAMBinterface.f90, calling the subroutine Transfer_GetMat...
void SetCAMBparams(void *params, const double ombh2, const double omch2, const double omnuh2, const double massless_nu, const int massive_nu, const int neutrino_hierarchy, const double omk, const double H0, const int dark_energy_model, const double w, const double wa, const double tau, const double cs2_lam, const double T_cmb, const double helium_fraction)
wrapper of the subroutine SetCAMBparams in CAMB/CAMBinterface.f90, setting CAMBparams parameters
void GetCAMBresults(void *params, void *data)
wrapper of the subroutine GetCAMBresults in CAMB/CAMBinterface.f90, calling the subroutine CAMB_GetRe...
void * GetCAMBparams()
wrapper of the function GetCAMBparams in CAMB/CAMBinterface.f90, creating an instance of the CAMBpara...
void SetCAMBPk(void *params, const double redshift, const double ns, const double As, const double pivot_scalar, const bool accurate_massive_nu, const double kmax, const bool nonlinear)
wrapper of the subroutine SetCAMBPk in CAMB/CAMBinterface.f90, setting the power spectrum parameters
int ErrorCBL(const std::string msg, const std::string functionCBL, const std::string fileCBL, const cbl::glob::ExitCode exitCode=cbl::glob::ExitCode::_error_)
throw an exception: it is used for handling exceptions inside the CosmoBolognaLib