7 #define GROWTH_TOLERANCE 6e-6 8 #define MGROWTH_TOLERANCE 5.0e-5 33 FILE * f = fopen(
"./tests/benchmark/growth_model1-5.txt",
"r");
39 rtn = fgets(str, 1024, f);
42 for (
int i=0; i<6; i++) {
43 int count = fscanf(f,
"%le %le %le %le %le %le\n", &z[i],
44 &gf[0][i], &gf[1][i], &gf[2][i], &gf[3][i], &gf[4][i]);
67 double Omega_v[5] = { 0.7, 0.7, 0.7, 0.65, 0.75 };
68 double w_0[5] = { -1.0, -0.9, -0.9, -0.9, -0.9 };
69 double w_a[5] = { 0.0, 0.0, 0.1, 0.1, 0.1 };
72 for (
int i=0; i<5; i++) {
73 data->Omega_v[i] = Omega_v[i];
74 data->w_0[i] = w_0[i];
75 data->w_a[i] = w_a[i];
76 data->Omega_k[i] = 1.0 - data->Omega_c - data->Omega_b - data->Omega_v[i];
88 ccl_parameters params =
ccl_parameters_create(data->
Omega_c, data->
Omega_b, data->
Omega_k[model], data->
Neff, data->
mnu, data->
mnu_type, data->
w_0[model], data->
w_a[model], data->
h, data->
A_s, data->
n_s,-1,-1,-1,-1,NULL,NULL, &status);
96 for (
int j=0; j<6; j++) {
97 double a = 1/(1.+data->
z[j]);
101 if (fabs(absolute_tolerance)<1e-12) absolute_tolerance = 1e-12;
117 z_mg=malloc(nz_mg*
sizeof(
double));
118 df_mg=malloc(nz_mg*
sizeof(
double));
119 for(ii=0;ii<nz_mg;ii++) {
120 z_mg[ii]=4*(ii+0.0)/(nz_mg-1.);
121 df_mg[ii]=0.1/(1+z_mg[ii]);
126 params1=
ccl_parameters_create(0.25,0.05,0,0,&mnuval, 1, -1,0,0.7,2.1E-9,0.96,-1,-1,-1,-1,NULL,NULL, &status);
127 params2=
ccl_parameters_create(0.25,0.05,0,0,&mnuval, 1, -1,0,0.7,2.1E-9,0.96,-1,-1,-1,nz_mg,z_mg,df_mg, &status);
138 for(ii=0;ii<nz_mg;ii++) {
139 double a=1./(1+z_mg[ii]);
145 double d2r=d1*exp(0.1*(a-1));
static void compare_growth(int model, struct growth_lowz_data *data)
ccl_mnu_convention mnu_type
double ccl_growth_factor(ccl_cosmology *cosmo, double a, int *status)
size_t count(InputIterator first, InputIterator last, T const &item)
double ccl_growth_factor_unnorm(ccl_cosmology *cosmo, double a, int *status)
#define CTEST_SETUP(sname)
#define CTEST_DATA(sname)
double ccl_growth_rate(ccl_cosmology *cosmo, double a, int *status)
ccl_cosmology * ccl_cosmology_create(ccl_parameters params, ccl_configuration config)
void ccl_cosmology_free(ccl_cosmology *cosmo)
static void check_mgrowth(void)
#define ASSERT_DBL_NEAR_TOL(exp, real, tol)
static void read_growth_test_file(double z[6], double gf[5][6])
const ccl_configuration default_config
#define ASSERT_EQUAL(exp, real)
#define ASSERT_NOT_NULL(real)
#define MGROWTH_TOLERANCE
ccl_parameters ccl_parameters_create(double Omega_c, double Omega_b, double Omega_k, double Neff, double *mnu, ccl_mnu_convention mnu_type, double w0, double wa, double h, double norm_pk, double n_s, double bcm_log10Mc, double bcm_etab, double bcm_ks, int nz_mgrowth, double *zarr_mgrowth, double *dfarr_mgrowth, int *status)
#define CTEST2(sname, tname)