Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
Cosmo_Param Class Reference

cosmological & CCL parameters More...

#include <params.hpp>

Collaboration diagram for Cosmo_Param:

Public Member Functions

void init ()
 lazy constructor More...
 
 Cosmo_Param ()
 
 ~Cosmo_Param ()
 
double Omega_c () const
 
double Omega_L () const
 
 operator void * () const
 

Public Attributes

ccl_configuration config
 
ccl_cosmologycosmo
 
double ns
 
double k2_G
 
double sigma8
 
double Omega_m
 
double Omega_b
 
double H0
 
double h
 
bool truncated_pk = false
 
double D_norm
 

Detailed Description

cosmological & CCL parameters

: class storing parameters for power spectrum

Definition at line 22 of file params.hpp.

Constructor & Destructor Documentation

Cosmo_Param::Cosmo_Param ( )

Definition at line 300 of file params.cpp.

300  :
301  // cosmo == NULL as indicator of uninitialization
302  // config first initialize to default (in case new configuration options are added)
303  config(default_config), cosmo(NULL) {}
ccl_cosmology * cosmo
Definition: params.hpp:32
ccl_configuration config
Definition: params.hpp:31
const ccl_configuration default_config
Definition: ccl_core.c:21
Cosmo_Param::~Cosmo_Param ( )

Definition at line 330 of file params.cpp.

References ccl_cosmology_free(), and cosmo.

331 {
332  if(cosmo){
334  cosmo = NULL;
335  }
336 }
ccl_cosmology * cosmo
Definition: params.hpp:32
void ccl_cosmology_free(ccl_cosmology *cosmo)
Definition: ccl_core.c:829

Member Function Documentation

void Cosmo_Param::init ( )

lazy constructor

  • basic quantities
  • create flat LCDM cosmology
  • compute value of growth factor normalization, use only when outside CCL range
  • normalize power spectrum

Definition at line 305 of file params.cpp.

References ccl_cosmology_create_flat_lcdm(), ccl_cosmology_free(), CCL_DEBUG_MODE_OFF, CCL_ERROR_POLICY_CONTINUE, ccl_set_debug_policy(), ccl_set_error_policy(), config, cosmo, D_norm, h, H0, norm_growth_factor(), norm_pwr(), ns, Omega_b, Omega_c(), sigma8, and ccl_cosmology::status_message.

Referenced by from_json().

306 {
307  // in case we call iniit once again, free cosmo first
308  if(cosmo)
309  {
311  cosmo = NULL;
312  }
314  h = H0/100;
315 
317  int status = 0;
321  if (status) throw std::runtime_error(cosmo->status_message);
322 
324  D_norm = norm_growth_factor(*this);
325 
327  norm_pwr(*this);
328 }
ccl_cosmology * cosmo
Definition: params.hpp:32
void ccl_set_debug_policy(CCLDebugModePolicy debug_policy)
Definition: ccl_error.c:29
void norm_pwr(Cosmo_Param &cosmo)
< end of anonymous namespace (private definitions)
Definition: core_power.cpp:400
static ccl_cosmology * ccl_cosmology_create_flat_lcdm(double Omega_c, double Omega_b, double h, double norm_pk, double n_s, ccl_configuration config, int *status)
Definition: params.cpp:280
double h
Definition: params.hpp:36
double D_norm
Definition: params.hpp:44
ccl_configuration config
Definition: params.hpp:31
double Omega_b
Definition: params.hpp:36
double H0
Definition: params.hpp:36
void ccl_cosmology_free(ccl_cosmology *cosmo)
Definition: ccl_core.c:829
double Omega_c() const
Definition: params.hpp:37
void ccl_set_error_policy(CCLErrorPolicy error_policy)
Definition: ccl_error.c:23
double ns
Definition: params.hpp:35
double sigma8
Definition: params.hpp:35
char status_message[500]
Definition: ccl_core.h:136
double norm_growth_factor(const Cosmo_Param &cosmo)
when computing growth factor outside CCL range we need to normalize the growth factor; ...
Definition: core_power.cpp:408
double Cosmo_Param::Omega_c ( ) const
inline

Definition at line 37 of file params.hpp.

References Omega_b.

Referenced by init(), and to_json().

37 { return Omega_m - Omega_b; }
double Omega_b
Definition: params.hpp:36
double Omega_m
Definition: params.hpp:36
Cosmo_Param::operator void * ( ) const
explicit

Definition at line 338 of file params.cpp.

340 {
341  return const_cast<Cosmo_Param*>(this);
342 }
cosmological & CCL parameters
Definition: params.hpp:22

Member Data Documentation

ccl_configuration Cosmo_Param::config

Definition at line 31 of file params.hpp.

Referenced by from_json(), handle_cmd_line(), init(), and to_json().

double Cosmo_Param::D_norm

Definition at line 44 of file params.hpp.

Referenced by growth_factor(), and init().

double Cosmo_Param::h

Definition at line 36 of file params.hpp.

Referenced by from_json(), init(), Box_Opt::init(), lin_pow_spec(), non_lin_pow_spec(), and to_json().

double Cosmo_Param::H0

Definition at line 36 of file params.hpp.

Referenced by from_json(), handle_cmd_line(), and init().

double Cosmo_Param::k2_G
double Cosmo_Param::ns

Definition at line 35 of file params.hpp.

Referenced by from_json(), handle_cmd_line(), init(), and to_json().

double Cosmo_Param::Omega_b

Definition at line 36 of file params.hpp.

Referenced by from_json(), handle_cmd_line(), init(), Omega_c(), and to_json().

double Cosmo_Param::sigma8

Definition at line 35 of file params.hpp.

Referenced by from_json(), handle_cmd_line(), init(), and to_json().

bool Cosmo_Param::truncated_pk = false

The documentation for this class was generated from the following files: