|
Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
|
definitions of cosmological functions like power spectrum, growth, etc. More...
#include "core_power.h"#include "class_data_vec.hpp"#include "params.hpp"#include <ccl_background.h>#include <ccl_power.h>#include <gsl/gsl_deriv.h>#include <gsl/gsl_errno.h>#include <gsl/gsl_fit.h>#include <gsl/gsl_integration.h>#include <gsl/gsl_odeiv2.h>#include <gsl/gsl_spline.h>

Go to the source code of this file.
Classes | |
| struct | anonymous_namespace{core_power.cpp}::integrand_param< P > |
| general integrand with callable function and one parameter More... | |
| class | anonymous_namespace{core_power.cpp}::Integr_obj |
| basic integration object, wrapper for GSL integration functions More... | |
| class | anonymous_namespace{core_power.cpp}::Integr_obj_qag |
| QAG adaptive integration. More... | |
| class | anonymous_namespace{core_power.cpp}::Integr_obj_qagiu |
| QAGI adaptive integration on infinite intervals. More... | |
| class | anonymous_namespace{core_power.cpp}::Integr_obj_qawo |
| QAWO adaptive integration for oscillatory functions. More... | |
| class | anonymous_namespace{core_power.cpp}::Integr_obj_qawf |
| QAWF adaptive integration for Fourier integrals. More... | |
| class | anonymous_namespace{core_power.cpp}::ODE_Solver |
| : Explicit embedded Runge-Kutta Prince-Dormand (8, 9) method. More... | |
Namespaces | |
| anonymous_namespace{core_power.cpp} | |
Functions | |
| template<typename T > | |
| T | anonymous_namespace{core_power.cpp}::hubble_param (T a, const Cosmo_Param &cosmo) |
| double | anonymous_namespace{core_power.cpp}::growth_factor_integrand (double a, void *params) |
| double | anonymous_namespace{core_power.cpp}::growth_factor (double a, void *params) |
| double | anonymous_namespace{core_power.cpp}::ln_growth_factor (double log_a, void *parameters) |
| template<typename T > | |
| size_t | anonymous_namespace{core_power.cpp}::get_nearest (const T val, const std::vector< T > &vec) |
| template<class P > | |
| double | anonymous_namespace{core_power.cpp}::xi_integrand_W (double k, void *params) |
| integrand for correlation function when weight-function 'sin(kr)' is used in integration More... | |
| template<class P > | |
| double | anonymous_namespace{core_power.cpp}::xi_integrand_G (double k, void *params) |
| integrand for correlation function when non-weighted integration is used More... | |
| template<class P > | |
| double | anonymous_namespace{core_power.cpp}::sigma_integrand_G (double k, void *params) |
| integrand for amplitude of mass fluctuaton when non-weighted integration is used More... | |
| template<class P , class T > | |
| void | anonymous_namespace{core_power.cpp}::gen_fce_r_binned_gsl (const double x_min, const double x_max, const double lin_bin, const P &P_k, Data_Vec< double, 2 > &fce_binned, T &fce_r) |
| compute given function in linear range and store results More... | |
| template<class P , class T > | |
| void | anonymous_namespace{core_power.cpp}::gen_corr_func_binned_gsl (const Sim_Param &sim, const P &P_k, Data_Vec< double, 2 > &corr_func_binned, T &xi_r) |
| compute correlation function and store results More... | |
| template<class P , class T > | |
| void | anonymous_namespace{core_power.cpp}::gen_sigma_func_binned_gsl (const Sim_Param &sim, const P &P_k, Data_Vec< double, 2 > &sigma_binned, T &sigma_r) |
| compute amplitude of density fluctuation and store results More... | |
| void | norm_pwr (Cosmo_Param &cosmo) |
| < end of anonymous namespace (private definitions) More... | |
| double | norm_growth_factor (const Cosmo_Param &cosmo) |
when computing growth factor outside CCL range we need to normalize the growth factor; More... | |
| double | growth_factor (double a, const Cosmo_Param &cosmo) |
| double | growth_rate (double a, const Cosmo_Param &cosmo) |
| double | growth_change (double a, const Cosmo_Param &cosmo) |
| double | Omega_lambda (double a, const Cosmo_Param &cosmo) |
| double | lin_pow_spec (double a, double k, const Cosmo_Param &cosmo) |
| double | non_lin_pow_spec (double a, double k, const Cosmo_Param &cosmo) |
| static double | truncation_fce (double k, double k2_G) |
| template<class P > | |
| static double | get_gsl_error (const Cosmo_Param &cosmo, const P &P_k) |
| template<class P > | |
| void | gen_corr_func_binned_gsl_qawf (const Sim_Param &sim, const P &P_k, Data_Vec< double, 2 > &corr_func_binned) |
| compute correlation function and store results More... | |
| void | gen_corr_func_binned_gsl_qawf_lin (const Sim_Param &sim, double a, Data_Vec< double, 2 > &corr_func_binned) |
| compute linear correlation function and store results More... | |
| void | gen_corr_func_binned_gsl_qawf_nl (const Sim_Param &sim, double a, Data_Vec< double, 2 > &corr_func_binned) |
| compute non-linear correlation function and store results More... | |
| template<class P > | |
| void | gen_sigma_binned_gsl_qawf (const Sim_Param &sim, const P &P_k, Data_Vec< double, 2 > &sigma_binned) |
| compute amplitude of density fluctuation and store results More... | |
| void | gen_sigma_func_binned_gsl_qawf_lin (const Sim_Param &sim, double a, Data_Vec< double, 2 > &sigma_binned) |
| compute linear amplitude of density fluctuation and store results More... | |
| void | gen_sigma_func_binned_gsl_qawf_nl (const Sim_Param &sim, double a, Data_Vec< double, 2 > &sigma_binned) |
| compute non-linear amplitude of density fluctuation and store results More... | |
| template void | gen_corr_func_binned_gsl_qawf (const Sim_Param &, const Extrap_Pk< double, 2 > &, Data_Vec< double, 2 > &) |
| template void | gen_corr_func_binned_gsl_qawf (const Sim_Param &, const Extrap_Pk< double, 3 > &, Data_Vec< double, 2 > &) |
| template void | gen_corr_func_binned_gsl_qawf (const Sim_Param &, const Extrap_Pk_Nl< double, 2 > &, Data_Vec< double, 2 > &) |
| template void | gen_corr_func_binned_gsl_qawf (const Sim_Param &, const Extrap_Pk_Nl< double, 3 > &, Data_Vec< double, 2 > &) |
| template void | gen_sigma_binned_gsl_qawf (const Sim_Param &, const Extrap_Pk< double, 2 > &, Data_Vec< double, 2 > &) |
| template void | gen_sigma_binned_gsl_qawf (const Sim_Param &, const Extrap_Pk< double, 3 > &, Data_Vec< double, 2 > &) |
| template void | gen_sigma_binned_gsl_qawf (const Sim_Param &, const Extrap_Pk_Nl< double, 2 > &, Data_Vec< double, 2 > &) |
| template void | gen_sigma_binned_gsl_qawf (const Sim_Param &, const Extrap_Pk_Nl< double, 3 > &, Data_Vec< double, 2 > &) |
Variables | |
| constexpr double | anonymous_namespace{core_power.cpp}::GSL_EPSABS = 1e-7 |
| absolute error at z = 0, scales for higher redshifts More... | |
| constexpr size_t | anonymous_namespace{core_power.cpp}::GSL_LIMIT = 1000 |
| max. number of subintervals for adaptive integration More... | |
| constexpr size_t | anonymous_namespace{core_power.cpp}::GSL_N = 100 |
| max. number of bisections of integration interval (QAWO / QAWF) More... | |
definitions of cosmological functions like power spectrum, growth, etc.
Definition in file core_power.cpp.
| void gen_corr_func_binned_gsl_qawf | ( | const Sim_Param & | sim, |
| const P & | P_k, | ||
| Data_Vec< double, 2 > & | corr_func_binned | ||
| ) |
compute correlation function and store results
| P | callable object with 'operator()(double)' |
| sim | simulation parameters |
| P_k | power spectrum (callable) |
| corr_func_binned | object to store binned correlation function |
Definition at line 665 of file core_power.cpp.
References Sim_Param::cosmo, anonymous_namespace{core_power.cpp}::gen_corr_func_binned_gsl(), get_gsl_error(), anonymous_namespace{core_power.cpp}::GSL_LIMIT, and anonymous_namespace{core_power.cpp}::GSL_N.
Referenced by gen_corr_func_binned_gsl_qawf_lin(), gen_corr_func_binned_gsl_qawf_nl(), gen_sigma_func_binned_gsl_qawf_nl(), and App_Var< T >::Impl< T >::print_corr().
| template void gen_corr_func_binned_gsl_qawf | ( | const Sim_Param & | , |
| const Extrap_Pk< double, 2 > & | , | ||
| Data_Vec< double, 2 > & | |||
| ) |
| template void gen_corr_func_binned_gsl_qawf | ( | const Sim_Param & | , |
| const Extrap_Pk< double, 3 > & | , | ||
| Data_Vec< double, 2 > & | |||
| ) |
| template void gen_corr_func_binned_gsl_qawf | ( | const Sim_Param & | , |
| const Extrap_Pk_Nl< double, 2 > & | , | ||
| Data_Vec< double, 2 > & | |||
| ) |
| template void gen_corr_func_binned_gsl_qawf | ( | const Sim_Param & | , |
| const Extrap_Pk_Nl< double, 3 > & | , | ||
| Data_Vec< double, 2 > & | |||
| ) |
| void gen_corr_func_binned_gsl_qawf_lin | ( | const Sim_Param & | sim, |
| double | a, | ||
| Data_Vec< double, 2 > & | corr_func_binned | ||
| ) |
compute linear correlation function and store results
| sim | simulation parameters |
| a | scale factor |
| corr_func_binned | object to store binned correlation function |
Definition at line 673 of file core_power.cpp.
References Sim_Param::cosmo, gen_corr_func_binned_gsl_qawf(), and lin_pow_spec().
Referenced by App_Var< T >::Impl< T >::print_corr().
| void gen_corr_func_binned_gsl_qawf_nl | ( | const Sim_Param & | sim, |
| double | a, | ||
| Data_Vec< double, 2 > & | corr_func_binned | ||
| ) |
compute non-linear correlation function and store results
| sim | simulation parameters |
| a | scale factor |
| corr_func_binned | object to store binned correlation function |
Definition at line 679 of file core_power.cpp.
References Sim_Param::cosmo, gen_corr_func_binned_gsl_qawf(), and non_lin_pow_spec().
| void gen_sigma_binned_gsl_qawf | ( | const Sim_Param & | sim, |
| const P & | P_k, | ||
| Data_Vec< double, 2 > & | sigma_binned | ||
| ) |
compute amplitude of density fluctuation and store results
| P | callable object with 'operator()(double)' |
| sim | simulation parameters |
| P_k | power spectrum (callable) |
| sigma_binned | object to store binned correlation function |
Definition at line 686 of file core_power.cpp.
References Sim_Param::cosmo, anonymous_namespace{core_power.cpp}::gen_sigma_func_binned_gsl(), get_gsl_error(), anonymous_namespace{core_power.cpp}::GSL_LIMIT, and anonymous_namespace{core_power.cpp}::GSL_N.
Referenced by gen_sigma_func_binned_gsl_qawf_lin(), and gen_sigma_func_binned_gsl_qawf_nl().
| template void gen_sigma_binned_gsl_qawf | ( | const Sim_Param & | , |
| const Extrap_Pk< double, 2 > & | , | ||
| Data_Vec< double, 2 > & | |||
| ) |
| template void gen_sigma_binned_gsl_qawf | ( | const Sim_Param & | , |
| const Extrap_Pk< double, 3 > & | , | ||
| Data_Vec< double, 2 > & | |||
| ) |
| template void gen_sigma_binned_gsl_qawf | ( | const Sim_Param & | , |
| const Extrap_Pk_Nl< double, 2 > & | , | ||
| Data_Vec< double, 2 > & | |||
| ) |
| template void gen_sigma_binned_gsl_qawf | ( | const Sim_Param & | , |
| const Extrap_Pk_Nl< double, 3 > & | , | ||
| Data_Vec< double, 2 > & | |||
| ) |
| void gen_sigma_func_binned_gsl_qawf_lin | ( | const Sim_Param & | sim, |
| double | a, | ||
| Data_Vec< double, 2 > & | sigma_binned | ||
| ) |
compute linear amplitude of density fluctuation and store results
| sim | simulation parameters |
| a | scale factor |
| sigma_binned | object to store binned correlation function |
Definition at line 694 of file core_power.cpp.
References Sim_Param::cosmo, gen_sigma_binned_gsl_qawf(), and lin_pow_spec().
| void gen_sigma_func_binned_gsl_qawf_nl | ( | const Sim_Param & | sim, |
| double | a, | ||
| Data_Vec< double, 2 > & | sigma_binned | ||
| ) |
compute non-linear amplitude of density fluctuation and store results
| sim | simulation parameters |
| a | scale factor |
| sigma_binned | object to store binned correlation function |
Definition at line 700 of file core_power.cpp.
References Sim_Param::cosmo, gen_corr_func_binned_gsl_qawf(), gen_sigma_binned_gsl_qawf(), Interp_obj::init(), and non_lin_pow_spec().
|
static |
Definition at line 656 of file core_power.cpp.
References anonymous_namespace{core_power.cpp}::GSL_EPSABS, and lin_pow_spec().
Referenced by gen_corr_func_binned_gsl_qawf(), and gen_sigma_binned_gsl_qawf().
| double growth_change | ( | double | a, |
| const Cosmo_Param & | cosmo | ||
| ) |
| a | |
| cosmo | cosmological parameters |
Definition at line 447 of file core_power.cpp.
References cl_cmbl_bm::cosmo, growth_factor(), and growth_rate().
Referenced by kick_step_no_momentum(), App_Var_Chi::ChiImpl::kick_step_w_chi_no_momentum(), App_Var< T >::Impl< T >::print_vel_pwr(), set_pert_pos(), and TEST_CASE().
| double growth_factor | ( | double | a, |
| const Cosmo_Param & | cosmo | ||
| ) |
| a | |
| cosmo | cosmological parameters |
Definition at line 414 of file core_power.cpp.
References ccl_growth_factor(), Cosmo_Param::cosmo, Cosmo_Param::D_norm, anonymous_namespace{core_power.cpp}::growth_factor_integrand(), and anonymous_namespace{core_power.cpp}::hubble_param().
Referenced by growth_change(), anonymous_namespace{core_power.cpp}::growth_factor(), lin_pow_spec(), and anonymous_namespace{core_power.cpp}::ln_growth_factor().
| double growth_rate | ( | double | a, |
| const Cosmo_Param & | cosmo | ||
| ) |
| a | |
| cosmo | cosmological parameters |
Definition at line 429 of file core_power.cpp.
References ccl_growth_rate(), cl_cmbl_bm::cosmo, Cosmo_Param::cosmo, and anonymous_namespace{core_power.cpp}::ln_growth_factor().
Referenced by growth_change(), and TEST_CASE().
| double lin_pow_spec | ( | double | a, |
| double | k, | ||
| const Cosmo_Param & | cosmo | ||
| ) |
| a | |
| k | |
| cosmo | cosmological parameters |
Definition at line 474 of file core_power.cpp.
References ccl_linear_matter_power(), Cosmo_Param::cosmo, growth_factor(), Cosmo_Param::h, pow(), and ccl_cosmology::status_message.
Referenced by Extrap_Pk< T, N >::fit_lin(), gen_corr_func_binned_gsl_qawf_lin(), gen_rho_w_pow_k(), gen_sigma_func_binned_gsl_qawf_lin(), get_gsl_error(), non_lin_pow_spec(), Extrap_Pk< T, N >::operator()(), and Extrap_Pk_Nl< T, N >::operator()().
| double non_lin_pow_spec | ( | double | a, |
| double | k, | ||
| const Cosmo_Param & | cosmo | ||
| ) |
| a | |
| k | |
| cosmo | cosmological parameters |
Definition at line 486 of file core_power.cpp.
References ccl_nonlin_matter_power(), Cosmo_Param::cosmo, Cosmo_Param::h, lin_pow_spec(), pow(), and ccl_cosmology::status_message.
Referenced by gen_corr_func_binned_gsl_qawf_nl(), gen_sigma_func_binned_gsl_qawf_nl(), and Extrap_Pk_Nl< T, N >::operator()().
| double norm_growth_factor | ( | const Cosmo_Param & | cosmo | ) |
when computing growth factor outside CCL range we need to normalize the growth factor;
| cosmo | cosmological parameters |
Definition at line 408 of file core_power.cpp.
References anonymous_namespace{core_power.cpp}::growth_factor_integrand().
Referenced by Cosmo_Param::init().
| void norm_pwr | ( | Cosmo_Param & | cosmo | ) |
< end of anonymous namespace (private definitions)
declaration in class_data_vec.hpp
PUBLIC FUNCTIONS DEFINITIONS *
Definition at line 400 of file core_power.cpp.
References ccl_sigma8(), Cosmo_Param::cosmo, and ccl_cosmology::status_message.
Referenced by Cosmo_Param::init().
| double Omega_lambda | ( | double | a, |
| const Cosmo_Param & | cosmo | ||
| ) |
| a | |
| cosmo | cosmological parameters |
Definition at line 462 of file core_power.cpp.
References ccl_omega_x(), ccl_species_l_label, Cosmo_Param::cosmo, Cosmo_Param::Omega_L(), Cosmo_Param::Omega_m, and pow().
Definition at line 554 of file core_power.cpp.
Referenced by Extrap_Pk< T, N >::fit_lin().