Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
anonymous_namespace{params.cpp} Namespace Reference

Functions

template<typename T , typename U >
find_value (const std::map< T, U > &map, const U &value)
 
size_t get_seed ()
 

Variables

const std::map< std::string, transfer_function_ttransfer_function_method
 
const std::map< std::string, matter_power_spectrum_tmatter_power_spectrum_method
 
const std::map< std::string, mass_function_tmass_function_method
 
const std::map< std::string, baryons_power_spectrum_tbaryons_power_spectrum_method
 

Detailed Description

PRIVATE FUNCTIONS DEFINITIONS *

Function Documentation

template<typename T , typename U >
T anonymous_namespace{params.cpp}::find_value ( const std::map< T, U > &  map,
const U &  value 
)

return first occurence of 'value' in std::std::map

Definition at line 57 of file params.cpp.

References x.

Referenced by Sim_Param::print_info(), and to_json().

58 {
59  for(auto x : map) if (x.second == value) return x.first;
60  throw std::out_of_range("Value not found");
61 }
static CCL_BEGIN_DECLS double x[111][8]
auto value(T const &val) -> Generator< T >
Definition: catch.hpp:3177
size_t anonymous_namespace{params.cpp}::get_seed ( )

Definition at line 63 of file params.cpp.

Referenced by Run_Opt::init(), and Run_Opt::simulate().

64 {
65  // random seed number
66  size_t seed = (static_cast<long>(rand()) << (sizeof(int) * 8)) | rand();
67 
68  // check for NULL pointer
69  if (char * job_id_str = std::getenv("SBATCH_JOBID"))
70  {
71  // check for succesfull conversion
72  if (long job_id = atol(job_id_str))
73  {
74  seed *= job_id;
75  }
76  }
77  else
78  {
79  BOOST_LOG_TRIVIAL(debug) << "Enviromental variable 'SBATCH_JOBID' was not found.";
80  }
81  return seed;
82 }

Variable Documentation

const std::map<std::string, baryons_power_spectrum_t> anonymous_namespace{params.cpp}::baryons_power_spectrum_method
Initial value:
= {
{"nobaryons", ccl_nobaryons},
{"bcm", ccl_bcm}
}

Definition at line 48 of file params.cpp.

Referenced by from_json(), Sim_Param::print_info(), and to_json().

const std::map<std::string, mass_function_t> anonymous_namespace{params.cpp}::mass_function_method
Initial value:
= {
{"tinker", ccl_tinker},
{"tinker10", ccl_tinker10},
{"watson", ccl_watson},
{"angulo", ccl_angulo},
{"shethtormen", ccl_shethtormen}
}

Definition at line 40 of file params.cpp.

Referenced by from_json(), Sim_Param::print_info(), and to_json().

const std::map<std::string, matter_power_spectrum_t> anonymous_namespace{params.cpp}::matter_power_spectrum_method
Initial value:
= {
{"linear", ccl_linear},
{"halofit", ccl_halofit},
{"halo_model", ccl_halo_model},
{"emu", ccl_emu}
}

Definition at line 33 of file params.cpp.

Referenced by from_json(), Sim_Param::print_info(), and to_json().

const std::map<std::string, transfer_function_t> anonymous_namespace{params.cpp}::transfer_function_method
Initial value:
= {
{"emulator", ccl_emulator},
{"eisenstein_hu", ccl_eisenstein_hu},
{"bbks", ccl_bbks},
{"boltzmann_class", ccl_boltzmann_class},
{"boltzmann_camb", ccl_boltzmann_camb}
}

Definition at line 25 of file params.cpp.

Referenced by from_json(), Sim_Param::print_info(), and to_json().