|
Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
|
#include <stdbool.h>#include <stdio.h>#include <gsl/gsl_spline.h>#include <gsl/gsl_interp2d.h>#include <gsl/gsl_spline2d.h>

Go to the source code of this file.
Classes | |
| struct | ccl_parameters |
| struct | ccl_data |
| struct | ccl_cosmology |
Typedefs | |
| typedef CCL_BEGIN_DECLS struct ccl_parameters | ccl_parameters |
| typedef struct ccl_data | ccl_data |
| typedef struct ccl_cosmology | ccl_cosmology |
| typedef enum ccl_mnu_convention | ccl_mnu_convention |
Enumerations | |
| enum | ccl_mnu_convention { ccl_mnu_list =0, ccl_mnu_sum =1, ccl_mnu_sum_inverted = 2, ccl_mnu_sum_equal = 3 } |
Functions | |
| void | ccl_cosmology_read_config (void) |
| ccl_cosmology * | ccl_cosmology_create (ccl_parameters params, ccl_configuration config) |
| void | ccl_cosmology_set_status_message (ccl_cosmology *cosmo, const char *status_message,...) |
| 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) |
| ccl_parameters | ccl_parameters_create_flat_lcdm (double Omega_c, double Omega_b, double h, double norm_pk, double n_s, int *status) |
| void | ccl_parameters_free (ccl_parameters *params) |
| void | ccl_parameters_write_yaml (ccl_parameters *params, const char *filename, int *status) |
| ccl_parameters | ccl_parameters_read_yaml (const char *filename, int *status) |
| void | ccl_cosmology_free (ccl_cosmology *cosmo) |
| typedef struct ccl_cosmology ccl_cosmology |
Sturct containing references to instances of the above structs, and boolean flags of precomputed values.
Struct containing references to gsl splines for distance and acceleration calculations
| typedef enum ccl_mnu_convention ccl_mnu_convention |
| typedef CCL_BEGIN_DECLS struct ccl_parameters ccl_parameters |
Struct containing the parameters defining a cosmology
| enum ccl_mnu_convention |
| Enumerator | |
|---|---|
| ccl_mnu_list | |
| ccl_mnu_sum | |
| ccl_mnu_sum_inverted | |
| ccl_mnu_sum_equal | |
Definition at line 142 of file ccl_core.h.
| 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 * | status_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().
| 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_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 | ||
| ) |
Read a cosmology parameters object from a file in yaml format, .
| filename | Name of existing file to read from |
| status | Status flag. 0 if there are no errors, nonzero otherwise. |
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, .
| params | Cosmological parameters |
| filename | Name of file to create and write |
| status | Status flag. 0 if there are no errors, nonzero otherwise. |
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().