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

Classes

class  Logger
 
class  Timer
 

Functions

void init_logging ()
 
template<class T >
void init_and_run_app (Sim_Param &sim)
 

Function Documentation

template<class T >
void anonymous_namespace{main.cpp}::init_and_run_app ( Sim_Param sim)

Definition at line 92 of file main.cpp.

References Sim_Param::cosmo, cl_cmbl_bm::l, anonymous_namespace{main.cpp}::Timer::stop(), and growth_allz::T.

93 {
94  // timer for wall time, CPU time
95  Timer t;
96 
97  // create approximation class and whether we have truncation in initial power spectrum
98  T APP(sim);
99  APP.update_cosmo(sim.cosmo);
100 
101  // register log file
102  Logger l(APP.get_out_dir() + "log/log" + "_%N.log");
103 
104  // run the simulation
105  APP.run_simulation();
106 
107  // stop timer manually so it is in the log file
108  t.stop();
109 }
Cosmo_Param cosmo
Definition: params.hpp:206
void anonymous_namespace{main.cpp}::init_logging ( )

Definition at line 35 of file main.cpp.

References Catch::cout().

Referenced by main().

36 {
37  // set logging core to log everything
38  logging::core::get()->set_filter
39  (
40  logging::trivial::severity >= logging::trivial::trace
41  );
42 
43  // add atributes
44  boost::log::add_common_attributes();
45  boost::log::register_simple_formatter_factory< boost::log::trivial::severity_level, char >("Severity");
46 
47  // register 'std:cout' as sink
48  boost::shared_ptr< sink_os_t > g_file_sink = logging::add_console_log(std::cout);
49  g_file_sink->set_filter(logging::trivial::severity >= logging::trivial::info);
50 }
std::ostream & cout()