|
Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
|
implementation for common functions for all types of approximations More...

Go to the source code of this file.
Macros | |
| #define | ORDER 1 |
| #define | N_MAX 1 |
Functions | |
| template<typename T > | |
| static T | mean (const std::vector< T > &data) |
| static double | mean (const Mesh &data) |
| template<typename T > | |
| static T | std_dev (const std::vector< T > &data, T mean) |
| static double | std_dev (const Mesh &data, double mean) |
| template<typename T > | |
| static T | min (const std::vector< T > &data) |
| static double | min (const Mesh &data) |
| template<typename T > | |
| static T | max (const std::vector< T > &data) |
| static double | max (const Mesh &data) |
| static void | set_unpert_pos_one_par (Vec_3D< size_t > &unpert_pos, const size_t par_index, const size_t par_per_dim, const size_t Ng) |
| static void | set_velocity_one_par (const Vec_3D< size_t > &unpert_pos, Vec_3D< double > &displ_field, const std::vector< Mesh > &vel_field) |
| void | set_unpert_pos (const Sim_Param &sim, std::vector< Particle_x< double >> &particles) |
| void | set_unpert_pos_w_vel (const Sim_Param &sim, std::vector< Particle_v< double >> &particles, const std::vector< Mesh > &vel_field) |
| void | set_pert_pos (const Sim_Param &sim, const double a, std::vector< Particle_x< double >> &particles, const std::vector< Mesh > &vel_field) |
| void | set_pert_pos (const Sim_Param &sim, const double a, std::vector< Particle_v< double >> &particles, const std::vector< Mesh > &vel_field) |
| static void | gen_gauss_white_noise (const Sim_Param &sim, Mesh &rho) |
| static double | truncation_fce (double k, double k2_G) |
| static void | gen_rho_w_pow_k (const Sim_Param &sim, Mesh &rho) |
| void | gen_rho_dist_k (const Sim_Param &sim, Mesh &rho, const FFTW_PLAN_TYPE &p_F) |
Generate density distributions in k-space. More... | |
| template<class T > | |
| void | get_rho_from_par (const std::vector< T > &particles, Mesh &rho, const Sim_Param &sim) |
| bool | get_vel_from_par (const std::vector< Particle_v< double >> &particles, std::vector< Mesh > &vel_field, const Sim_Param &sim) |
| bool | get_vel_from_par (const std::vector< Particle_x< double >> &particles, std::vector< Mesh > &vel_field, const Sim_Param &sim) |
| void | pwr_spec_k (const Mesh &rho_k, Mesh &power_aux) |
| void | pwr_spec_k_init (const Mesh &rho_k, Mesh &power_aux) |
| void | vel_pwr_spec_k (const std::vector< Mesh > &vel_field, Mesh &power_aux) |
| void | gen_cqty_binned (const double x_min, const double x_max, const size_t bins_per_decade, const Mesh &qty_mesh, const size_t half_length, Data_Vec< double, 2 > &qty_binned, const double mod_q, const double mod_x) |
| void | gen_cqty_binned (const double x_min, const double x_max, const size_t bins_per_decade, const Mesh &qty_mesh, Data_Vec< double, 2 > &qty_binned, const double mod_q, const double mod_x) |
| void | gen_pow_spec_binned (const Sim_Param &sim, const Mesh &power_aux, Data_Vec< double, 2 > &pwr_spec_binned) |
| void | gen_pow_spec_binned_init (const Sim_Param &sim, const Mesh &power_aux, const size_t half_length, Data_Vec< double, 2 > &pwr_spec_binned) |
| template<class P , typename T , size_t N> | |
| void | gen_pow_spec_binned_from_extrap (const Sim_Param &sim, const P &P_k, Data_Vec< T, N > &pwr_spec_binned) |
| void | gen_pot_k (const Mesh &rho_k, Mesh &pot_k) |
| void | gen_pot_k (Mesh &rho_k) |
| static double | S2_shape (const double k2, const double a) |
| static double | CIC_opt (Vec_3D< double > k_vec, const double a) |
| void | gen_displ_k_S2 (std::vector< Mesh > &vel_field, const Mesh &pot_k, const double a) |
| void | gen_displ_k (std::vector< Mesh > &vel_field, const Mesh &pot_k) |
| void | gen_displ_k_cic (std::vector< Mesh > &vel_field, const Mesh &pot_k) |
| void | gen_dens_binned (const Mesh &rho, std::vector< size_t > &dens_binned, const Sim_Param &sim) |
| template void | get_rho_from_par (const std::vector< Particle_x< double >> &, Mesh &, const Sim_Param &) |
| template void | get_rho_from_par (const std::vector< Particle_v< double >> &, Mesh &, const Sim_Param &) |
| template void | gen_pow_spec_binned_from_extrap (const Sim_Param &, const Extrap_Pk< double, 2 > &, Data_Vec< double, 2 > &) |
implementation for common functions for all types of approximations
Definition in file core_app.cpp.
| #define N_MAX 1 |
Referenced by CIC_opt().
| #define ORDER 1 |
Definition at line 15 of file core_app.cpp.
Referenced by pwr_spec_k(), and vel_pwr_spec_k().
Definition at line 531 of file core_app.cpp.
References N_MAX, PI, pow2(), and S2_shape().
Referenced by gen_displ_k_S2().
| void gen_cqty_binned | ( | const double | x_min, |
| const double | x_max, | ||
| const size_t | bins_per_decade, | ||
| const Mesh & | qty_mesh, | ||
| const size_t | half_length, | ||
| Data_Vec< double, 2 > & | qty_binned, | ||
| const double | mod_q, | ||
| const double | mod_x | ||
| ) |
Definition at line 401 of file core_app.cpp.
References Catch::Matchers::Vector::Detail::count(), Data_Vec< T, N >::erase(), Data_Vec< T, N >::fill(), Data_Vec< T, N >::resize(), Data_Vec< T, N >::size(), and x.
Referenced by gen_cqty_binned(), gen_pow_spec_binned(), and gen_pow_spec_binned_init().
| void gen_cqty_binned | ( | const double | x_min, |
| const double | x_max, | ||
| const size_t | bins_per_decade, | ||
| const Mesh & | qty_mesh, | ||
| Data_Vec< double, 2 > & | qty_binned, | ||
| const double | mod_q, | ||
| const double | mod_x | ||
| ) |
Definition at line 454 of file core_app.cpp.
References gen_cqty_binned(), and Mesh_base< T >::length.
| void gen_dens_binned | ( | const Mesh & | rho, |
| std::vector< size_t > & | dens_binned, | ||
| const Sim_Param & | sim | ||
| ) |
Definition at line 627 of file core_app.cpp.
References Sim_Param::box_opt, gen_pow_spec_binned_from_extrap(), get_rho_from_par(), Mesh::N, Box_Opt::Ng_pwr, and pow().
Referenced by App_Var< T >::Impl< T >::print_density().
Definition at line 623 of file core_app.cpp.
References gen_displ_k_S2().
Referenced by App_Var_AA::AAImpl::aa_convolution(), and App_Var< T >::Impl< T >::set_init_cond().
Definition at line 625 of file core_app.cpp.
References gen_displ_k_S2().
Referenced by App_Var_Chi::ChiImpl::get_chi_force(), and App_Var< T >::pot_corr().
Definition at line 586 of file core_app.cpp.
References CIC_opt(), get_k_vec(), and PI.
Referenced by gen_displ_k(), gen_displ_k_cic(), and App_Var_FP_mod::pot_corr().
Definition at line 165 of file core_app.cpp.
References max(), mean(), min(), Mesh::N, Mesh_base< T >::N1, Sim_Param::run_opt, Run_Opt::seed, sqrt(), and std_dev().
Referenced by gen_rho_dist_k().
Definition at line 496 of file core_app.cpp.
References get_k_sq(), Mesh_base< T >::length, Mesh::N, PI, and pow2().
Referenced by gen_pot_k(), anonymous_namespace{test_chameleon.cpp}::get_grav_pot(), App_Var< T >::Impl< T >::set_init_cond(), and App_Var_PM::upd_pos().
| void gen_pot_k | ( | Mesh & | rho_k | ) |
| void gen_pow_spec_binned | ( | const Sim_Param & | sim, |
| const Mesh & | power_aux, | ||
| Data_Vec< double, 2 > & | pwr_spec_binned | ||
| ) |
Definition at line 460 of file core_app.cpp.
References Out_Opt::bins_per_decade, Sim_Param::box_opt, Box_Opt::box_size, gen_cqty_binned(), Box_Opt::mesh_num_pwr, Sim_Param::out_opt, PI, and pow().
Referenced by App_Var_Chi::ChiImpl::gen_pow_spec_binned(), App_Var< T >::Impl< T >::get_binned_power_spec(), and App_Var< T >::Impl< T >::print_vel_pwr().
| void gen_pow_spec_binned_from_extrap | ( | const Sim_Param & | sim, |
| const P & | P_k, | ||
| Data_Vec< T, N > & | pwr_spec_binned | ||
| ) |
Definition at line 478 of file core_app.cpp.
References Out_Opt::bins_per_decade, Other_par::k_print, Range::lower, Sim_Param::other_par, Sim_Param::out_opt, pow(), Data_Vec< T, N >::resize(), Data_Vec< T, N >::size(), growth_allz::T, and Range::upper.
Referenced by gen_dens_binned(), and App_Var< T >::Impl< T >::print_extrap_pwr().
| template void gen_pow_spec_binned_from_extrap | ( | const Sim_Param & | , |
| const Extrap_Pk< double, 2 > & | , | ||
| Data_Vec< double, 2 > & | |||
| ) |
| void gen_pow_spec_binned_init | ( | const Sim_Param & | sim, |
| const Mesh & | power_aux, | ||
| const size_t | half_length, | ||
| Data_Vec< double, 2 > & | pwr_spec_binned | ||
| ) |
Definition at line 468 of file core_app.cpp.
References Out_Opt::bins_per_decade, Sim_Param::box_opt, Box_Opt::box_size, gen_cqty_binned(), Box_Opt::mesh_num, Sim_Param::out_opt, PI, and pow().
Referenced by App_Var< T >::Impl< T >::print_input_realisation().
| void gen_rho_dist_k | ( | const Sim_Param & | sim, |
| Mesh & | rho, | ||
| const FFTW_PLAN_TYPE & | p_F | ||
| ) |
Generate density distributions
in k-space.
| sim | |
| rho | |
| p_F |
At first, a gaussian white noise (mean = 0, stdDev = 1) is generated, then it is convoluted with given power spectrum.
Definition at line 267 of file core_app.cpp.
References fftw_execute_dft_r2c(), gen_gauss_white_noise(), and gen_rho_w_pow_k().
Referenced by App_Var< T >::Impl< T >::set_init_cond().
Definition at line 221 of file core_app.cpp.
References Sim_Param::box_opt, Box_Opt::box_size, Sim_Param::cosmo, get_k_sq(), Cosmo_Param::k2_G, Mesh_base< T >::length, lin_pow_spec(), Mesh::N, Run_Opt::phase, PI, pow(), Sim_Param::run_opt, sqrt(), Cosmo_Param::truncated_pk, and truncation_fce().
Referenced by gen_rho_dist_k().
| void get_rho_from_par | ( | const std::vector< T > & | particles, |
| Mesh & | rho, | ||
| const Sim_Param & | sim | ||
| ) |
Definition at line 278 of file core_app.cpp.
References Mesh_base< T >::assign(), assign_to(), Sim_Param::box_opt, m, Box_Opt::mesh_num, Mesh::N, Box_Opt::par_num, and pow().
Referenced by gen_dens_binned(), App_Var< T >::Impl< T >::print_output(), App_Var_Chi::ChiImpl::solve(), and App_Var_PM::upd_pos().
| template void get_rho_from_par | ( | const std::vector< Particle_x< double >> & | , |
| Mesh & | , | ||
| const Sim_Param & | |||
| ) |
| template void get_rho_from_par | ( | const std::vector< Particle_v< double >> & | , |
| Mesh & | , | ||
| const Sim_Param & | |||
| ) |
| bool get_vel_from_par | ( | const std::vector< Particle_v< double >> & | particles, |
| std::vector< Mesh > & | vel_field, | ||
| const Sim_Param & | sim | ||
| ) |
Definition at line 300 of file core_app.cpp.
References assign_to(), Sim_Param::box_opt, m, Box_Opt::mesh_num, Box_Opt::mesh_num_pwr, Box_Opt::Ng_pwr, Box_Opt::par_num, and pow().
Referenced by App_Var< T >::Impl< T >::print_output().
| bool get_vel_from_par | ( | const std::vector< Particle_x< double >> & | particles, |
| std::vector< Mesh > & | vel_field, | ||
| const Sim_Param & | sim | ||
| ) |
Definition at line 318 of file core_app.cpp.
|
static |
Definition at line 61 of file core_app.cpp.
Referenced by assign_to_grid(), ContinuitySolver< NDIM, T >::bfunc(), nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_integer_size(), nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_unsigned_size(), gen_gauss_white_noise(), cl_cmbl_bm.Power_Spectra::kappa_cl(), cl_cmblx_bm.Power_Spectra::kappa_cl(), max(), nlohmann::detail::binary_writer< BasicJsonType, CharType >::ubjson_prefix(), nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_integer(), nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_unsigned(), nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_cbor(), nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_msgpack(), and nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_number_with_ubjson_prefix().
|
static |
Definition at line 19 of file core_app.cpp.
References growth_allz::T.
Referenced by gen_gauss_white_noise(), and mean().
|
static |
Definition at line 51 of file core_app.cpp.
Referenced by gen_gauss_white_noise(), and min().
Definition at line 324 of file core_app.cpp.
References get_k_vec(), Mesh_base< T >::length, Mesh::N, halomod_bm::NM, ORDER, PI, and pow().
Referenced by App_Var< T >::Impl< T >::get_binned_power_spec().
Definition at line 349 of file core_app.cpp.
References get_k_vec(), Mesh_base< T >::length, Mesh::N, halomod_bm::NM, and pow2().
Referenced by App_Var_Chi::ChiImpl::gen_pow_spec_binned(), and App_Var< T >::Impl< T >::print_input_realisation().
| void set_pert_pos | ( | const Sim_Param & | sim, |
| const double | a, | ||
| std::vector< Particle_x< double >> & | particles, | ||
| const std::vector< Mesh > & | vel_field | ||
| ) |
Definition at line 114 of file core_app.cpp.
References Sim_Param::box_opt, Sim_Param::cosmo, get_per(), growth_allz::growth_factor, Box_Opt::mesh_num, Box_Opt::Ng, Box_Opt::par_num, Box_Opt::par_num_1d, set_unpert_pos_one_par(), and set_velocity_one_par().
Referenced by App_Var< T >::Impl< T >::set_init_pos(), and App_Var_ZA::upd_pos().
| void set_pert_pos | ( | const Sim_Param & | sim, |
| const double | a, | ||
| std::vector< Particle_v< double >> & | particles, | ||
| const std::vector< Mesh > & | vel_field | ||
| ) |
Definition at line 139 of file core_app.cpp.
References Sim_Param::box_opt, Sim_Param::cosmo, get_per(), growth_change(), growth_allz::growth_factor, Box_Opt::mesh_num, Box_Opt::Ng, Box_Opt::par_num, Box_Opt::par_num_1d, set_unpert_pos_one_par(), and set_velocity_one_par().
| void set_unpert_pos | ( | const Sim_Param & | sim, |
| std::vector< Particle_x< double >> & | particles | ||
| ) |
Definition at line 82 of file core_app.cpp.
References Sim_Param::box_opt, Box_Opt::Ng, Box_Opt::par_num, Box_Opt::par_num_1d, and set_unpert_pos_one_par().
|
static |
Definition at line 70 of file core_app.cpp.
Referenced by set_pert_pos(), set_unpert_pos(), and set_unpert_pos_w_vel().
| void set_unpert_pos_w_vel | ( | const Sim_Param & | sim, |
| std::vector< Particle_v< double >> & | particles, | ||
| const std::vector< Mesh > & | vel_field | ||
| ) |
Definition at line 97 of file core_app.cpp.
References Sim_Param::box_opt, Box_Opt::Ng, Box_Opt::par_num, Box_Opt::par_num_1d, set_unpert_pos_one_par(), and set_velocity_one_par().
|
static |
Definition at line 77 of file core_app.cpp.
Referenced by set_pert_pos(), and set_unpert_pos_w_vel().
|
static |
Definition at line 35 of file core_app.cpp.
References pow2(), sqrt(), and growth_allz::T.
Referenced by gen_gauss_white_noise(), and std_dev().
Definition at line 216 of file core_app.cpp.
Referenced by gen_rho_w_pow_k().
Definition at line 366 of file core_app.cpp.
References get_k_vec(), halomod_bm::NM, ORDER, PI, and pow().
Referenced by App_Var< T >::Impl< T >::print_vel_pwr().