Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
test_core_power.cpp File Reference
#include <catch.hpp>
#include <boost/log/trivial.hpp>
#include "../core_power.cpp"
Include dependency graph for test_core_power.cpp:

Go to the source code of this file.

Macros

#define BOOST_LOG_DYN_LINK   1
 

Functions

 TEST_CASE ("UNIT TEST: growth functions {growth_factor, growth_rate, growth_change}","[core_power]")
 

Macro Definition Documentation

#define BOOST_LOG_DYN_LINK   1

Definition at line 3 of file test_core_power.cpp.

Function Documentation

TEST_CASE ( "UNIT TEST: growth functions {growth_factor, growth_rate, growth_change}"  ,
""  [core_power] 
)

Definition at line 8 of file test_core_power.cpp.

References ccl_test_power::argv, CHECK, Sim_Param::cosmo, growth_change(), growth_allz::growth_factor, and growth_rate().

8  : growth functions {growth_factor, growth_rate, growth_change}", "[core_power]" )
9 {
10  BOOST_LOG_TRIVIAL(info) << "growth functions {growth_factor, growth_rate, growth_change}";
11 
12  int argc = 1;
13  const char* const argv[1] = {"test"};
14  Sim_Param sim(argc, argv);
15  FTYPE_t D, D_to_a, f, Oma, OLa, dDda, factor;
16  for (FTYPE_t a =0; a <= 1.0; a += 0.1)
17  {
18  D = growth_factor(a, sim.cosmo);
19  f = growth_rate(a, sim.cosmo);
20  dDda = growth_change(a, sim.cosmo);
21  D_to_a = a ? D/a : dDda;
22  CHECK( dDda == Approx(D_to_a*f) );
23  }
24 
25  CHECK(0.0 == growth_factor(0, sim.cosmo));
26  CHECK(1.0 == growth_factor(1, sim.cosmo));
27 }
double growth_rate(double a, const Cosmo_Param &cosmo)
Definition: core_power.cpp:429
double growth_change(double a, const Cosmo_Param &cosmo)
Definition: core_power.cpp:447