|
Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
|
interface for common functions for all types of approximations More...
#include "stdafx.h"#include "app_var.hpp"#include "core_power.h"#include "params.hpp"#include "precision.hpp"#include "class_particles.hpp"

Go to the source code of this file.
Functions | |
| 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) |
| void | gen_rho_dist_k (const Sim_Param &sim, Mesh &rho, const FFTW_PLAN_TYPE &p_F) |
Generate density distributions in k-space. More... | |
| void | gen_pot_k (const Mesh &rho_k, Mesh &pot_k) |
| void | gen_pot_k (Mesh &rho_k) |
| 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_displ_k_S2 (std::vector< Mesh > &vel_field, const Mesh &pot_k, const double a) |
| 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_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_dens_binned (const Mesh &rho, std::vector< size_t > &dens_binned, const Sim_Param &sim) |
interface for common functions for all types of approximations
Definition in file core_app.h.
| 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 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().
| 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().
| 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().
| 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.
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().
| 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().
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().