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

run options More...

#include <params.hpp>

Public Member Functions

void init ()
 
void reset ()
 
bool is_ready ()
 
bool simulate ()
 

Public Attributes

size_t nt
 
size_t nt_fftw
 
size_t mlt_runs
 
size_t seed
 
bool pair
 
bool phase = true
 

Detailed Description

run options

Definition at line 128 of file params.hpp.

Member Function Documentation

void Run_Opt::init ( )

Definition at line 344 of file params.cpp.

References anonymous_namespace{params.cpp}::get_seed().

Referenced by from_json().

345 {
346  if(nt == 0) nt = omp_get_max_threads();
347  else omp_set_num_threads(nt);
348  if(nt_fftw == 0) nt_fftw = nt;
349  if (seed == 0){
350  srand(time(NULL));
351  seed = get_seed();
352  } else mlt_runs = 1;
353 }
size_t nt_fftw
Definition: params.hpp:134
size_t mlt_runs
Definition: params.hpp:134
size_t nt
Definition: params.hpp:134
size_t seed
Definition: params.hpp:135
bool Run_Opt::is_ready ( )

Definition at line 360 of file params.cpp.

361 {
362  return (mlt_runs != 0);
363 }
size_t mlt_runs
Definition: params.hpp:134
void Run_Opt::reset ( )

Definition at line 355 of file params.cpp.

356 {
357  mlt_runs = 0;
358 }
size_t mlt_runs
Definition: params.hpp:134
bool Run_Opt::simulate ( )

Definition at line 365 of file params.cpp.

References anonymous_namespace{params.cpp}::get_seed().

Referenced by Sim_Param::simulate().

366 {
367  if (!pair || !phase)
368  {
369  mlt_runs--;
370  seed = get_seed();
371  }
372  if (pair) phase = !phase;
373  return mlt_runs;
374 }
bool phase
Definition: params.hpp:138
size_t mlt_runs
Definition: params.hpp:134
bool pair
Definition: params.hpp:136
size_t seed
Definition: params.hpp:135

Member Data Documentation

size_t Run_Opt::mlt_runs

Definition at line 134 of file params.hpp.

Referenced by handle_cmd_line().

size_t Run_Opt::nt

Definition at line 134 of file params.hpp.

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

size_t Run_Opt::nt_fftw

Definition at line 134 of file params.hpp.

Referenced by App_Var< T >::Impl< T >::fftw_prep(), and handle_cmd_line().

bool Run_Opt::pair

Definition at line 136 of file params.hpp.

Referenced by handle_cmd_line().

bool Run_Opt::phase = true

Definition at line 138 of file params.hpp.

Referenced by from_json(), gen_rho_w_pow_k(), and to_json().

size_t Run_Opt::seed

Definition at line 135 of file params.hpp.

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


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