|
Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
|
functions handling output of the program More...
#include <iomanip>#include <boost/filesystem.hpp>#include "core_out.h"#include "class_particles.hpp"
Go to the source code of this file.
Macros | |
| #define | BUFF_SIZE 1024 * 1024 * 16 |
| #define | HALF_THICKNESS 2 |
| #define | MAX_SIZE 512 |
Functions | |
| std::string | currentDateTime () |
| std::string | std_out_dir (const std::string &pre_subdir, const Sim_Param &sim) |
| void | create_dir (const std::string &out_dir) |
| void | remove_dir (const std::string &out_dir) |
| void | remove_all_files (const std::string &out_dir) |
| template<class T > | |
| void | print_par_pos_cut_small (const std::vector< T > &particles, const Sim_Param &sim, std::string out_dir, std::string suffix) |
| void | print_pow_spec (const Data_Vec< double, 2 > &pwr_spec_binned, std::string out_dir, std::string suffix) |
| void | print_vel_pow_spec (const Data_Vec< double, 2 > &pwr_spec_binned, std::string out_dir, std::string suffix) |
| void | print_corr_func (const Data_Vec< double, 2 > &pwr_spec_binned, std::string out_dir, std::string suffix) |
| template<typename T > | |
| T | rel_error (const T &a, const T &b) |
| template<typename T > | |
| bool | is_err (const std::vector< T > &vec1, const std::vector< T > &vec2, size_t bin) |
| void | print_pow_spec_diff (const Data_Vec< double, 2 > &pwr_spec_binned, const Data_Vec< double, 2 > &pwr_spec_binned_0, double growth, std::string out_dir, std::string suffix) |
| void | print_pow_spec_diff (const Data_Vec< double, 2 > &pwr_spec_binned, const Interp_obj &pwr_spec_input, double growth, std::string out_dir, std::string suffix) |
| void | print_pow_spec_diff (const Data_Vec< double, 2 > &pwr_spec_binned, const Data_Vec< double, 2 > &pwr_spec_binned_0, const Interp_obj &pwr_spec_input, double growth_now, double growth_init, std::string out_dir, std::string suffix) |
| void | print_vel_pow_spec_diff (const Data_Vec< double, 2 > &pwr_spec_binned, const Data_Vec< double, 2 > &pwr_spec_binned_0, double dDda, std::string out_dir, std::string suffix) |
| void | print_rho_map (const Mesh &delta, const Sim_Param &sim, std::string out_dir, std::string suffix) |
| void | print_projected_rho (const Mesh &delta, const Sim_Param &sim, std::string out_dir, std::string suffix) |
| void | print_dens_bin (const std::vector< size_t > &dens_binned, std::string out_dir, std::string suffix) |
| template void | print_par_pos_cut_small (const std::vector< Particle_x< double >> &, const Sim_Param &, std::string, std::string) |
| template void | print_par_pos_cut_small (const std::vector< Particle_v< double >> &, const Sim_Param &, std::string, std::string) |
| #define BUFF_SIZE 1024 * 1024 * 16 |
Definition at line 16 of file core_out.cpp.
| #define HALF_THICKNESS 2 |
Referenced by print_rho_map().
| #define MAX_SIZE 512 |
Referenced by print_rho_map().
| void create_dir | ( | const std::string & | out_dir | ) |
Definition at line 74 of file core_out.cpp.
References ccl_test_distances::path.
Referenced by App_Var< T >::Impl< T >::create_work_dir(), and TEST_CASE().
| std::string currentDateTime | ( | ) |
Definition at line 41 of file core_out.cpp.
Referenced by std_out_dir().
| bool is_err | ( | const std::vector< T > & | vec1, |
| const std::vector< T > & | vec2, | ||
| size_t | bin | ||
| ) |
Definition at line 197 of file core_out.cpp.
References rel_error(), growth_allz::T, and Catch::Generators::value().
Referenced by print_pow_spec_diff(), and print_vel_pow_spec_diff().
| void print_corr_func | ( | const Data_Vec< double, 2 > & | pwr_spec_binned, |
| std::string | out_dir, | ||
| std::string | suffix | ||
| ) |
Definition at line 174 of file core_out.cpp.
References Data_Vec< T, N >::size().
Referenced by App_Var< T >::Impl< T >::print_corr().
| void print_dens_bin | ( | const std::vector< size_t > & | dens_binned, |
| std::string | out_dir, | ||
| std::string | suffix | ||
| ) |
Definition at line 402 of file core_out.cpp.
References print_par_pos_cut_small().
Referenced by App_Var< T >::Impl< T >::print_density().
| void print_par_pos_cut_small | ( | const std::vector< T > & | particles, |
| const Sim_Param & | sim, | ||
| std::string | out_dir, | ||
| std::string | suffix | ||
| ) |
Definition at line 109 of file core_out.cpp.
References Sim_Param::box_opt, Box_Opt::mesh_num, Box_Opt::par_num, x, Sim_Param::x_0(), and z.
Referenced by print_dens_bin(), and App_Var< T >::Impl< T >::print_position().
| template void print_par_pos_cut_small | ( | const std::vector< Particle_x< double >> & | , |
| const Sim_Param & | , | ||
| std::string | , | ||
| std::string | |||
| ) |
| template void print_par_pos_cut_small | ( | const std::vector< Particle_v< double >> & | , |
| const Sim_Param & | , | ||
| std::string | , | ||
| std::string | |||
| ) |
| void print_pow_spec | ( | const Data_Vec< double, 2 > & | pwr_spec_binned, |
| std::string | out_dir, | ||
| std::string | suffix | ||
| ) |
Definition at line 134 of file core_out.cpp.
References Data_Vec< T, N >::size().
Referenced by App_Var< T >::Impl< T >::print_extrap_pwr(), App_Var< T >::Impl< T >::print_input_realisation(), App_Var_Chi::print_output(), and App_Var< T >::Impl< T >::print_power_spec().
| void print_pow_spec_diff | ( | const Data_Vec< double, 2 > & | pwr_spec_binned, |
| const Data_Vec< double, 2 > & | pwr_spec_binned_0, | ||
| double | growth, | ||
| std::string | out_dir, | ||
| std::string | suffix | ||
| ) |
Definition at line 211 of file core_out.cpp.
References is_err(), pow2(), and Data_Vec< T, N >::size().
Referenced by App_Var< T >::Impl< T >::print_power_spec().
| void print_pow_spec_diff | ( | const Data_Vec< double, 2 > & | pwr_spec_binned, |
| const Interp_obj & | pwr_spec_input, | ||
| double | growth, | ||
| std::string | out_dir, | ||
| std::string | suffix | ||
| ) |
Definition at line 235 of file core_out.cpp.
References pow2(), Data_Vec< T, N >::size(), Interp_obj::x_max, and Interp_obj::x_min.
| void print_pow_spec_diff | ( | const Data_Vec< double, 2 > & | pwr_spec_binned, |
| const Data_Vec< double, 2 > & | pwr_spec_binned_0, | ||
| const Interp_obj & | pwr_spec_input, | ||
| double | growth_now, | ||
| double | growth_init, | ||
| std::string | out_dir, | ||
| std::string | suffix | ||
| ) |
Definition at line 263 of file core_out.cpp.
References is_err(), pow2(), Data_Vec< T, N >::size(), Interp_obj::x_max, and Interp_obj::x_min.
| void print_projected_rho | ( | const Mesh & | delta, |
| const Sim_Param & | sim, | ||
| std::string | out_dir, | ||
| std::string | suffix | ||
| ) |
Definition at line 376 of file core_out.cpp.
References Sim_Param::box_opt, Box_Opt::mesh_num_pwr, and Sim_Param::x_0_pwr().
| void print_rho_map | ( | const Mesh & | delta, |
| const Sim_Param & | sim, | ||
| std::string | out_dir, | ||
| std::string | suffix | ||
| ) |
Definition at line 317 of file core_out.cpp.
References Sim_Param::box_opt, HALF_THICKNESS, MAX_SIZE, Box_Opt::mesh_num_pwr, and Sim_Param::x_0_pwr().
Referenced by App_Var< T >::Impl< T >::print_density().
| void print_vel_pow_spec | ( | const Data_Vec< double, 2 > & | pwr_spec_binned, |
| std::string | out_dir, | ||
| std::string | suffix | ||
| ) |
Definition at line 154 of file core_out.cpp.
References Data_Vec< T, N >::size().
Referenced by App_Var< T >::Impl< T >::print_vel_pwr().
| void print_vel_pow_spec_diff | ( | const Data_Vec< double, 2 > & | pwr_spec_binned, |
| const Data_Vec< double, 2 > & | pwr_spec_binned_0, | ||
| double | dDda, | ||
| std::string | out_dir, | ||
| std::string | suffix | ||
| ) |
Definition at line 294 of file core_out.cpp.
References is_err(), pow2(), and Data_Vec< T, N >::size().
Referenced by App_Var< T >::Impl< T >::print_vel_pwr().
| T rel_error | ( | const T & | a, |
| const T & | b | ||
| ) |
Definition at line 191 of file core_out.cpp.
Referenced by is_err().
| void remove_all_files | ( | const std::string & | out_dir | ) |
Definition at line 92 of file core_out.cpp.
References p, and ccl_test_distances::path.
Referenced by TEST_CASE().
| void remove_dir | ( | const std::string & | out_dir | ) |
| std::string std_out_dir | ( | const std::string & | pre_subdir, |
| const Sim_Param & | sim | ||
| ) |
directory name = YYMMDD_HHMMSS_m_p_M_b
check if directory exists
try appending numbers starting at 2
Definition at line 53 of file core_out.cpp.
References Sim_Param::box_opt, Box_Opt::box_size, currentDateTime(), exists(), Box_Opt::mesh_num, Box_Opt::mesh_num_pwr, Box_Opt::Ng, Out_Opt::out_dir, Sim_Param::out_opt, and ccl_test_distances::path.