|
Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
|
#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <math.h>#include <string.h>#include <gsl/gsl_errno.h>#include <gsl/gsl_odeiv.h>#include <gsl/gsl_spline.h>#include <gsl/gsl_integration.h>#include "ccl.h"#include "ccl_params.h"
Go to the source code of this file.
Macros | |
| #define | EXPAND_STR(s) STRING(s) |
| #define | STRING(s) #s |
| #define | MATCH(s, action) if (0 == strcmp(var_name, s)) { action ; continue;} do{} while(0) |
| #define | WRITE_DOUBLE(name) fprintf(f, #name ": %le\n",params->name) |
| #define | WRITE_INT(name) fprintf(f, #name ": %d\n",params->name) |
| #define | READ_DOUBLE(name) double name; *status |= (0==fscanf(f, #name ": %le\n",&name)); |
| #define | READ_INT(name) int name; *status |= (0==fscanf(f, #name ": %d\n",&name)) |
Variables | |
| const ccl_configuration | default_config = {ccl_boltzmann_class, ccl_halofit, ccl_nobaryons, ccl_tinker10, ccl_duffy2008, ccl_emu_strict} |
| const ccl_gsl_params | default_gsl_params |
| ccl_spline_params * | ccl_splines = ((void*)0) |
| ccl_gsl_params * | ccl_gsl = ((void*)0) |
| #define EXPAND_STR | ( | s | ) | STRING(s) |
Definition at line 17 of file ccl_core.c.
Referenced by ccl_cosmology_read_config().
| #define MATCH | ( | s, | |
| action | |||
| ) | if (0 == strcmp(var_name, s)) { action ; continue;} do{} while(0) |
Referenced by ccl_cosmology_read_config().
| #define READ_DOUBLE | ( | name | ) | double name; *status |= (0==fscanf(f, #name ": %le\n",&name)); |
Referenced by ccl_parameters_read_yaml().
| #define READ_INT | ( | name | ) | int name; *status |= (0==fscanf(f, #name ": %d\n",&name)) |
Referenced by ccl_parameters_read_yaml().
| #define STRING | ( | s | ) | #s |
Definition at line 18 of file ccl_core.c.
| #define WRITE_DOUBLE | ( | name | ) | fprintf(f, #name ": %le\n",params->name) |
Referenced by ccl_parameters_write_yaml().
| #define WRITE_INT | ( | name | ) | fprintf(f, #name ": %d\n",params->name) |
Referenced by ccl_parameters_write_yaml().
| ccl_cosmology* ccl_cosmology_create | ( | ccl_parameters | params, |
| ccl_configuration | config | ||
| ) |
Definition at line 173 of file ccl_core.c.
References ccl_data::accelerator, ccl_data::accelerator_achi, ccl_data::accelerator_d, ccl_data::accelerator_k, ccl_data::accelerator_m, ccl_data::achi, ccl_data::alphahmf, ccl_data::betahmf, ccl_cosmology_set_status_message(), ccl_data::chi, ccl_cosmology::computed_distances, ccl_cosmology::computed_growth, ccl_cosmology::computed_hmfparams, ccl_cosmology::computed_power, ccl_cosmology::computed_sigma, ccl_cosmology::config, cl_cmbl_bm::cosmo, ccl_cosmology::data, ccl_data::dlnsigma_dlogm, ccl_data::E, ccl_data::etahmf, ccl_data::fgrowth, ccl_data::gammahmf, ccl_data::growth, ccl_data::growth0, ccl_data::logsigma, ccl_data::p_lin, ccl_data::p_nl, halomod_bm::params, ccl_cosmology::params, ccl_data::phihmf, and ccl_cosmology::status.
Referenced by ccl_cosmology_create_flat_lcdm(), check_mgrowth(), compare_bbks(), compare_bcm(), compare_cls(), compare_corr(), compare_correlation_3d(), compare_distances(), compare_distances_hiz(), compare_distances_hiz_mnu(), compare_distances_mnu(), compare_eh(), compare_emu(), compare_emu_nu(), compare_growth(), compare_growth_hiz(), compare_halomod(), compare_massfunc(), compare_power_nu(), compare_power_nu_nl(), compare_sigmam(), main(), test_angpow_precision(), and write_Pk_CLASS().
| void ccl_cosmology_free | ( | ccl_cosmology * | cosmo | ) |
Free a cosmology struct
| cosmo | Cosmological parameters |
Definition at line 829 of file ccl_core.c.
References ccl_data_free(), and ccl_cosmology::data.
Referenced by check_mgrowth(), compare_bbks(), compare_bcm(), compare_cls(), compare_corr(), compare_correlation_3d(), compare_distances(), compare_distances_hiz(), compare_distances_hiz_mnu(), compare_distances_mnu(), compare_eh(), compare_emu(), compare_emu_nu(), compare_growth(), compare_growth_hiz(), compare_power_nu(), compare_power_nu_nl(), Cosmo_Param::init(), main(), test_angpow_precision(), write_Pk_CLASS(), and Cosmo_Param::~Cosmo_Param().
| void ccl_cosmology_read_config | ( | void | ) |
Definition at line 50 of file ccl_core.c.
References ccl_spline_params::A_SPLINE_MAX, ccl_spline_params::A_SPLINE_MIN, ccl_spline_params::A_SPLINE_MIN_PK, ccl_spline_params::A_SPLINE_MINLOG, ccl_spline_params::A_SPLINE_MINLOG_PK, ccl_spline_params::A_SPLINE_NA, ccl_spline_params::A_SPLINE_NA_PK, ccl_spline_params::A_SPLINE_NLOG, ccl_spline_params::A_SPLINE_NLOG_PK, CCL_ERROR_MEMORY, CCL_ERROR_MISSING_CONFIG_FILE, ccl_raise_exception(), ccl_spline_params::ELL_MAX_CORR, ccl_spline_params::ELL_MIN_CORR, ccl_gsl_params::EPSREL, EXPAND_STR, ccl_gsl_params::INTEGRATION_DISTANCE_EPSREL, ccl_gsl_params::INTEGRATION_DNDZ_EPSREL, ccl_gsl_params::INTEGRATION_EPSREL, ccl_gsl_params::INTEGRATION_GAUSS_KRONROD_POINTS, ccl_gsl_params::INTEGRATION_LIMBER_EPSREL, ccl_gsl_params::INTEGRATION_LIMBER_GAUSS_KRONROD_POINTS, ccl_gsl_params::INTEGRATION_NU_EPSABS, ccl_gsl_params::INTEGRATION_NU_EPSREL, ccl_gsl_params::INTEGRATION_SIGMAR_EPSREL, ccl_spline_params::K_MAX, ccl_spline_params::K_MAX_SPLINE, ccl_spline_params::K_MIN, ccl_spline_params::LOGM_SPLINE_DELTA, ccl_spline_params::LOGM_SPLINE_MAX, ccl_spline_params::LOGM_SPLINE_MIN, ccl_spline_params::LOGM_SPLINE_NM, MATCH, ccl_spline_params::N_ELL_CORR, ccl_gsl_params::N_ITERATION, ccl_spline_params::N_K, ccl_spline_params::N_K_3DCOR, ccl_gsl_params::ODE_GROWTH_EPSREL, ccl_gsl_params::ROOT_EPSREL, and ccl_gsl_params::ROOT_N_ITERATION.
Referenced by calculate_nu_phasespace_spline(), ccl_dNdz_tomog(), ccl_norm_integrand(), and ccl_parameters_create().
| void ccl_cosmology_set_status_message | ( | ccl_cosmology * | cosmo, |
| const char * | message, | ||
| ... | |||
| ) |
Definition at line 792 of file ccl_core.c.
References ccl_cosmology::status_message.
Referenced by ccl_angular_cl_native(), ccl_angular_cls(), ccl_comoving_angular_distance(), ccl_comoving_radial_distance(), ccl_correlation(), ccl_correlation_3d(), ccl_cosmology_compute_distances(), ccl_cosmology_compute_growth(), ccl_cosmology_compute_hmfparams(), ccl_cosmology_compute_power(), ccl_cosmology_compute_power_bbks(), ccl_cosmology_compute_power_class(), ccl_cosmology_compute_power_eh(), ccl_cosmology_compute_power_emu(), ccl_cosmology_compute_sigma(), ccl_cosmology_create(), ccl_cosmology_write_power_class_z(), ccl_distance_modulus(), ccl_fill_class_parameters(), ccl_free_class_structs(), ccl_get_tracer_fa(), ccl_get_tracer_fas(), ccl_growth_factor(), ccl_growth_rate(), ccl_h_over_h0(), ccl_halo_b1(), ccl_halo_bias(), ccl_halo_concentration(), ccl_linear_matter_power(), ccl_massfunc(), ccl_nonlin_matter_power(), ccl_omega_x(), ccl_pkemu(), ccl_power_extrapol_highk(), ccl_power_extrapol_lowk(), ccl_run_class(), ccl_scale_factor_of_chi(), ccl_sigmaM(), ccl_sinn(), ccl_tracer_corr_bessel(), ccl_tracer_corr_fftlog(), ccl_tracer_corr_legendre(), cl_tracer(), clt_init_ba(), clt_init_bz(), clt_init_nz(), clt_init_rf(), clt_init_wL(), clt_init_wM(), clt_nc_init(), massfunc_f(), one_halo_integral(), and two_halo_integral().
| void ccl_data_free | ( | ccl_data * | data | ) |
Definition at line 761 of file ccl_core.c.
References ccl_data::accelerator, ccl_data::accelerator_achi, ccl_data::accelerator_d, ccl_data::accelerator_k, ccl_data::accelerator_m, ccl_data::achi, ccl_data::alphahmf, ccl_data::betahmf, ccl_data::chi, ccl_data::dlnsigma_dlogm, ccl_data::E, ccl_data::etahmf, ccl_data::fgrowth, ccl_data::gammahmf, ccl_data::growth, ccl_data::logsigma, ccl_data::p_lin, ccl_data::p_nl, and ccl_data::phihmf.
Referenced by ccl_cosmology_free().
| 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 | ||
| ) |
Create a cosmology
| Omega_c | Omega_c |
| Omega_b | Omega_b |
| Omega_k | Omega_k |
| Neff | Number of relativistic neutrino species in the early universe |
| mnu | neutrino mass, either sum or list of length 3 |
| mnu_type | determines neutrino mass convention (ccl_mnu_list, ccl_mnu_sum, ccl_mnu_sum_inverted, ccl_mnu_sum_equal) |
| w0 | Dark energy EoS parameter |
| wa | Dark energy EoS parameter |
| h | Hubble constant in units of 100 km/s/Mpc |
| norm_pk | the normalization of the power spectrum, either A_s or sigma8 |
| n_s | the power-law index of the power spectrum |
| bcm_log10Mc | log10 cluster mass, one of the parameters of the BCM model |
| bcm_etab | ejection radius parameter, one of the parameters of the BCM model |
| bcm_ks | wavenumber for the stellar profile, one of the parameters of the BCM model |
| nz_mgrowth | the number of redshifts where the modified growth is provided |
| zarr_mgrowth | the array of redshifts where the modified growth is provided |
| dfarr_mgrowth | the modified growth function vector provided |
| status | Status flag. 0 if there are no errors, nonzero otherwise. For specific cases see documentation for ccl_error.c |
Definition at line 294 of file ccl_core.c.
References ccl_parameters::A_s, ccl_parameters::bcm_etab, ccl_parameters::bcm_ks, ccl_parameters::bcm_log10Mc, ccl_check_status_nocosmo(), ccl_cosmology_read_config(), CCL_ERROR_MNU_UNPHYSICAL, CCL_ERROR_NOT_IMPLEMENTED, ccl_mnu_list, ccl_mnu_sum, ccl_mnu_sum_equal, ccl_mnu_sum_inverted, ccl_parameters_fill_initial(), DELTAM12_sq, DELTAM13_sq_neg, DELTAM13_sq_pos, ccl_parameters::df_mgrowth, ccl_test_distances::h, ccl_parameters::h, ccl_parameters::H0, ccl_parameters::has_mgrowth, ccl_test_distances::mnu, ccl_parameters::mnu, ccl_parameters::N_nu_mass, ccl_test_distances::n_s, ccl_parameters::n_s, ccl_test_distances::Neff, ccl_parameters::Neff, ccl_parameters::nz_mgrowth, ccl_parameters::Omega_b, ccl_test_distances::Omega_b, ccl_parameters::Omega_c, ccl_test_distances::Omega_c, ccl_parameters::Omega_k, halomod_bm::params, ccl_parameters::sigma8, sqrt(), ccl_parameters::sum_nu_masses, ccl_parameters::w0, ccl_parameters::wa, and ccl_parameters::z_mgrowth.
Referenced by __ctest_create_mnu_create_mnu_inv_run(), __ctest_parameters_create_general_nu_list_run(), __ctest_parameters_create_general_nu_sum_equal_run(), __ctest_parameters_create_general_nu_sum_inverted_run(), __ctest_parameters_create_general_nu_sum_run(), ccl_cosmology_create_flat_lcdm(), ccl_parameters_create_flat_lcdm(), ccl_parameters_read_yaml(), check_mgrowth(), compare_bbks(), compare_bcm(), compare_correlation_3d(), compare_distances(), compare_distances_hiz(), compare_distances_hiz_mnu(), compare_distances_mnu(), compare_eh(), compare_emu(), compare_emu_nu(), compare_growth(), compare_growth_hiz(), compare_halomod(), compare_massfunc(), compare_power_nu(), compare_power_nu_nl(), compare_sigmam(), main(), test_angpow_precision(), and write_Pk_CLASS().
| ccl_parameters ccl_parameters_create_flat_lcdm | ( | double | Omega_c, |
| double | Omega_b, | ||
| double | h, | ||
| double | norm_pk, | ||
| double | n_s, | ||
| int * | status | ||
| ) |
Definition at line 505 of file ccl_core.c.
References ccl_mnu_sum, ccl_parameters_create(), ccl_test_distances::mnu, ccl_test_distances::Neff, and halomod_bm::params.
Referenced by __ctest_parameters_read_write_run(), compare_cls(), compare_corr(), and main().
| void ccl_parameters_fill_initial | ( | ccl_parameters * | params, |
| int * | status | ||
| ) |
Definition at line 226 of file ccl_core.c.
References ccl_parameters::A_s, ccl_check_status_nocosmo(), ccl_Omeganuh2(), CLIGHT, CLIGHT_HMPC, ccl_parameters::h, ccl_parameters::k_sign, ccl_parameters::mnu, MPC_TO_METER, ccl_parameters::N_nu_mass, ccl_parameters::N_nu_rel, ccl_parameters::Neff, ccl_parameters::Omega_b, ccl_test_distances::Omega_c, ccl_parameters::Omega_g, ccl_parameters::Omega_k, ccl_parameters::Omega_l, ccl_parameters::Omega_m, ccl_parameters::Omega_n_mass, ccl_parameters::Omega_n_rel, pow(), RHO_CRITICAL, ccl_parameters::sigma8, SOLAR_MASS, sqrt(), ccl_parameters::sqrtk, STBOLTZ, ccl_parameters::T_CMB, TCMB, TNCDM, and ccl_parameters::z_star.
Referenced by ccl_parameters_create().
| void ccl_parameters_free | ( | ccl_parameters * | params | ) |
Free a parameters struct
| params | ccl_parameters struct |
Definition at line 808 of file ccl_core.c.
References ccl_parameters::df_mgrowth, ccl_parameters::mnu, and ccl_parameters::z_mgrowth.
| ccl_parameters ccl_parameters_read_yaml | ( | const char * | filename, |
| int * | status | ||
| ) |
Write a cosmology parameters object to a file in yaml format.
| cosmo | Cosmological parameters |
| f | FILE* pointer opened for reading |
Definition at line 624 of file ccl_core.c.
References ccl_test_distances::A_s, CCL_ERROR_FILE_READ, ccl_mnu_list, ccl_parameters_create(), ccl_raise_exception(), ccl_test_distances::h, ccl_test_distances::mnu, ccl_test_distances::n_s, ccl_test_distances::Neff, ccl_test_distances::Omega_b, ccl_test_distances::Omega_c, halomod_bm::params, READ_DOUBLE, READ_INT, and ccl_test_power::sigma8.
Referenced by __ctest_parameters_read_write_run().
| void ccl_parameters_write_yaml | ( | ccl_parameters * | params, |
| const char * | filename, | ||
| int * | status | ||
| ) |
Write a cosmology parameters object to a file in yaml format.
| cosmo | Cosmological parameters |
| f | FILE* pointer opened for reading |
Definition at line 531 of file ccl_core.c.
References ccl_test_distances::A_s, CCL_ERROR_FILE_WRITE, ccl_parameters::df_mgrowth, ccl_test_distances::h, ccl_parameters::has_mgrowth, ccl_parameters::mnu, ccl_parameters::N_nu_mass, ccl_test_distances::n_s, ccl_test_distances::Neff, ccl_parameters::nz_mgrowth, ccl_test_distances::Omega_b, ccl_test_distances::Omega_c, ccl_test_power::sigma8, WRITE_DOUBLE, WRITE_INT, and ccl_parameters::z_mgrowth.
Referenced by __ctest_parameters_read_write_run().
| ccl_gsl_params* ccl_gsl = ((void*)0) |
Definition at line 48 of file ccl_core.c.
Referenced by a_of_chi(), calculate_nu_phasespace_spline(), ccl_angular_cl_native(), ccl_cosmology_compute_growth(), ccl_dNdz_tomog(), ccl_norm_integrand(), ccl_sigmaR(), ccl_sigmaV(), ccl_tracer_corr_bessel(), clt_init_nz(), compare_cls(), compare_corr(), compute_chi(), growth_factor_and_growth_rate(), window_lensing(), and window_magnification().
| ccl_spline_params* ccl_splines = ((void*)0) |
Definition at line 47 of file ccl_core.c.
Referenced by calculate_nu_phasespace_spline(), ccl_correlation_3d(), ccl_cosmology_compute_distances(), ccl_cosmology_compute_growth(), ccl_cosmology_compute_power_bbks(), ccl_cosmology_compute_power_class(), ccl_cosmology_compute_power_eh(), ccl_cosmology_compute_power_emu(), ccl_cosmology_compute_sigma(), ccl_dNdz_tomog(), ccl_fill_class_parameters(), ccl_linear_matter_power(), ccl_nonlin_matter_power(), ccl_norm_integrand(), ccl_sigmaR(), ccl_sigmaV(), ccl_tracer_corr_bessel(), ccl_tracer_corr_fftlog(), ccl_tracer_corr_legendre(), get_k_interval(), and main().
| const ccl_configuration default_config = {ccl_boltzmann_class, ccl_halofit, ccl_nobaryons, ccl_tinker10, ccl_duffy2008, ccl_emu_strict} |
The default configuration object In the default configuration, defined in ccl_core.c CCL runs with: default_config = {ccl_boltzmann_class, ccl_halofit, ccl_nobaryons, ccl_tinker10, ccl_duffy2008, ccl_emu_strict}
Definition at line 21 of file ccl_core.c.
Referenced by check_mgrowth(), compare_bbks(), compare_bcm(), compare_cls(), compare_corr(), compare_correlation_3d(), compare_distances(), compare_distances_hiz(), compare_distances_hiz_mnu(), compare_distances_mnu(), compare_eh(), compare_emu(), compare_emu_nu(), compare_growth(), compare_growth_hiz(), compare_halomod(), compare_massfunc(), compare_power_nu(), compare_power_nu_nl(), compare_sigmam(), main(), test_angpow_precision(), and write_Pk_CLASS().
| const ccl_gsl_params default_gsl_params |
Definition at line 23 of file ccl_core.c.