Skip to content
Snippets Groups Projects
Commit 0fd1bbd4 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Moved the new time-step bin constant to the timeline.h file.

parent 43b0648f
No related branches found
No related tags found
1 merge request!956Fully implement the timestep limiter (non MPI)
...@@ -26,9 +26,6 @@ ...@@ -26,9 +26,6 @@
/* Time-step limiter maximal difference in signal velocity */ /* Time-step limiter maximal difference in signal velocity */
#define const_limiter_max_v_sig_ratio 4.1f #define const_limiter_max_v_sig_ratio 4.1f
/* Maximal difference in time-bins between neighbouring particles */
#define const_timestep_limiter_max_delta_bin 2
/* I/O Constant; this determines the relative tolerance between the value of /* I/O Constant; this determines the relative tolerance between the value of
* redshift read from the snapshot, and the value from the parameter file. This * redshift read from the snapshot, and the value from the parameter file. This
* current value asserts that they must match within 0.1%. */ * current value asserts that they must match within 0.1%. */
......
...@@ -50,6 +50,10 @@ typedef int8_t timebin_t; ...@@ -50,6 +50,10 @@ typedef int8_t timebin_t;
/*! Fictitious time-bin for particles woken up */ /*! Fictitious time-bin for particles woken up */
#define time_bin_awake (-1) #define time_bin_awake (-1)
/* Maximal difference in time-bins between neighbouring particles */
#define time_bin_neighbour_max_delta_bin 2
/** /**
* @brief Returns the integer time interval corresponding to a time bin * @brief Returns the integer time interval corresponding to a time bin
* *
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* @brief Compute a valid integer time-step form a given time-step * @brief Compute a valid integer time-step form a given time-step
* *
* We consider the minimal time-bin of any neighbours and prevent particles * We consider the minimal time-bin of any neighbours and prevent particles
* to differ from it by a fixed constant `const_timestep_limiter_max_delta_bin`. * to differ from it by a fixed constant `time_bin_neighbour_max_delta_bin`.
* *
* If min_ngb_bin is set to `num_time_bins`, then no limit from the neighbours * If min_ngb_bin is set to `num_time_bins`, then no limit from the neighbours
* is imposed. * is imposed.
...@@ -53,7 +53,7 @@ make_integer_timestep(const float new_dt, const timebin_t old_bin, ...@@ -53,7 +53,7 @@ make_integer_timestep(const float new_dt, const timebin_t old_bin,
/* Are we allowed to use this bin given the neighbours? */ /* Are we allowed to use this bin given the neighbours? */
timebin_t new_bin = get_time_bin(new_dti); timebin_t new_bin = get_time_bin(new_dti);
new_bin = min(new_bin, min_ngb_bin + const_timestep_limiter_max_delta_bin); new_bin = min(new_bin, min_ngb_bin + time_bin_neighbour_max_delta_bin);
new_dti = get_integer_timestep(new_bin); new_dti = get_integer_timestep(new_bin);
/* Current time-step */ /* Current time-step */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment