MP-Gadget
5.0.1.dev1-76bc7d4726-dirty
|
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include "timebinmgr.h"
#include "utils.h"
Go to the source code of this file.
Classes | |
struct | sync_params |
Functions | |
int | cmp_double (const void *a, const void *b) |
int | OutputListAction (ParameterSet *ps, const char *name, void *data) |
void | set_sync_params (int OutputListLength, double *OutputListTimes) |
void | setup_sync_points (double TimeIC, double TimeMax, double no_snapshot_until_time, int SnapshotWithFOF) |
SyncPoint * | find_next_sync_point (inttime_t ti) |
SyncPoint * | find_current_sync_point (inttime_t ti) |
static double | Dloga_interval_ti (inttime_t ti) |
double | loga_from_ti (inttime_t ti) |
inttime_t | ti_from_loga (double loga) |
double | dloga_from_dti (inttime_t dti, const inttime_t Ti_Current) |
inttime_t | dti_from_dloga (double loga, const inttime_t Ti_Current) |
double | get_dloga_for_bin (int timebin, const inttime_t Ti_Current) |
inttime_t | round_down_power_of_two (inttime_t dti) |
Variables | |
static SyncPoint * | SyncPoints |
static int | NSyncPoints |
static struct sync_params | Sync |
int cmp_double | ( | const void * | a, |
const void * | b | ||
) |
Definition at line 17 of file timebinmgr.c.
Referenced by setup_sync_points().
Definition at line 256 of file timebinmgr.c.
References Dloga_interval_ti(), endrun(), and TIMEBASE.
Referenced by apply_half_kick(), density(), density_ngbiter(), find_timesteps(), and hydro_ngbiter().
|
static |
Definition at line 207 of file timebinmgr.c.
References SyncPoint::loga, NSyncPoints, SyncPoints, TIMEBASE, and TIMEBINS.
Referenced by dloga_from_dti(), get_dloga_for_bin(), and loga_from_ti().
Definition at line 271 of file timebinmgr.c.
References loga_from_ti(), and ti_from_loga().
Referenced by get_PM_timestep_ti(), and get_timestep_ti().
Definition at line 188 of file timebinmgr.c.
References NSyncPoints, and SyncPoints.
Referenced by run(), test_conversions(), and test_skip_first().
this function returns the next output time that is in the future of ti_curr; if none is find it return NULL, indication the run shall terminate.
Definition at line 174 of file timebinmgr.c.
References NSyncPoints, and SyncPoints.
Referenced by get_PM_timestep_ti(), run(), and test_conversions().
double get_dloga_for_bin | ( | int | timebin, |
const inttime_t | Ti_Current | ||
) |
Definition at line 279 of file timebinmgr.c.
References Dloga_interval_ti().
Referenced by blackhole_accretion_postprocess(), blackhole_feedback_copy(), cooling_direct(), get_helium_neutral_fraction_sfreff(), get_neutral_fraction_sfreff(), get_sfr_eeqos(), get_timestep_dloga(), hydro_copy(), hydro_ngbiter(), print_timebin_statistics(), run(), sfr_wind_copy(), test_dloga(), and winds_evolve().
double loga_from_ti | ( | inttime_t | ti | ) |
Definition at line 223 of file timebinmgr.c.
References Dloga_interval_ti(), endrun(), SyncPoint::loga, NSyncPoints, SyncPoints, TIMEBASE, and TIMEBINS.
Referenced by dti_from_dloga().
int OutputListAction | ( | ParameterSet * | ps, |
const char * | name, | ||
void * | data | ||
) |
This function parses a string containing a comma-separated list of variables, each of which is interpreted as a double. The purpose is to read an array of output times into the code. So specifying the output list now looks like: OutputList 0.1,0.3,0.5,1.0
We sort the input after reading it, so that the initial list need not be sorted. This function could be repurposed for reading generic arrays in future.
Definition at line 31 of file timebinmgr.c.
References endrun(), fastpm_strdup(), MAXSNAPSHOTS, message(), myfree, name, sync_params::OutputListLength, sync_params::OutputListTimes, param_get_string(), and Sync.
Referenced by create_gadget_parameter_set().
Definition at line 286 of file timebinmgr.c.
References TIMEBASE.
Referenced by find_timesteps(), get_PM_timestep_ti(), init_timeline(), and test_dloga().
void set_sync_params | ( | int | OutputListLength, |
double * | OutputListTimes | ||
) |
Definition at line 76 of file timebinmgr.c.
References OutputListLength, sync_params::OutputListLength, sync_params::OutputListTimes, and Sync.
Referenced by setup().
void setup_sync_points | ( | double | TimeIC, |
double | TimeMax, | ||
double | no_snapshot_until_time, | ||
int | SnapshotWithFOF | ||
) |
Definition at line 97 of file timebinmgr.c.
References SyncPoint::a, cmp_double(), SyncPoint::loga, myfree, mymalloc, NSyncPoints, sync_params::OutputListLength, sync_params::OutputListTimes, qsort_openmp, Sync, SyncPoints, SyncPoint::ti, TIMEBINS, SyncPoint::write_fof, and SyncPoint::write_snapshot.
Referenced by init_timeline(), setup_density(), test_conversions(), test_dloga(), and test_skip_first().
inttime_t ti_from_loga | ( | double | loga | ) |
Definition at line 236 of file timebinmgr.c.
References SyncPoint::loga, NSyncPoints, SyncPoints, TIMEBASE, and TIMEBINS.
Referenced by dti_from_dloga(), init_timebins(), init_timeline(), test_conversions(), and test_dloga().
|
static |
Definition at line 10 of file timebinmgr.c.
Referenced by Dloga_interval_ti(), find_current_sync_point(), find_next_sync_point(), loga_from_ti(), setup_sync_points(), and ti_from_loga().
|
static |
Referenced by OutputListAction(), set_sync_params(), and setup_sync_points().
|
static |
table with desired sync points. All forces and phase space variables are synchonized to the same order.
Definition at line 9 of file timebinmgr.c.
Referenced by Dloga_interval_ti(), find_current_sync_point(), find_next_sync_point(), loga_from_ti(), setup_sync_points(), and ti_from_loga().