diff --git a/src/engine.h b/src/engine.h index cd0dd45e2712601d36f2fca7ae4e09bb98376a9d..1aa0c304829908b2a70c9c53c7970da3931ff721 100644 --- a/src/engine.h +++ b/src/engine.h @@ -690,7 +690,6 @@ void engine_allocate_foreign_particles(struct engine *e, const int fof); void engine_print_stats(struct engine *e); void engine_io(struct engine *e); void engine_io_check_snapshot_triggers(struct engine *e); -void engine_io_verify_triggers_size(const struct engine *e); void engine_collect_end_of_step(struct engine *e, int apply); void engine_collect_end_of_sub_cycle(struct engine *e); void engine_dump_snapshot(struct engine *e); diff --git a/src/engine_config.c b/src/engine_config.c index f47594101c60e3efddb1d6969bf705bd81a6c650..e6b028fdee2ab2bbbea1a29b77d268a4def3095c 100644 --- a/src/engine_config.c +++ b/src/engine_config.c @@ -613,10 +613,6 @@ void engine_config(int restart, int fof, struct engine *e, /* Read (or re-read the list of outputs */ engine_init_output_lists(e, params, e->output_options); - /* Verify that the snapshot triggers are compatible with the - * output list */ - engine_io_verify_triggers_size(e); - /* Check whether output quantities make sense */ if (e->policy & engine_policy_cosmology) { diff --git a/src/engine_io.c b/src/engine_io.c index 4dcab578a92c3d823062f376622b92d837e821a5..c8e86f4ee8bd451469d0d7de15e38f9730def089 100644 --- a/src/engine_io.c +++ b/src/engine_io.c @@ -1449,147 +1449,3 @@ void engine_io_check_snapshot_triggers(struct engine *e) { } } } - -void check_triggers(const struct engine *e, const double snapshot_delta) { - - return; - - /* Verify the part triggers */ - for (int i = 0; i < num_snapshot_triggers_part; ++i) { - if (e->snapshot_recording_triggers_part[i] > snapshot_delta) { - error( - "The recording time for the part trigger %d (dt=%e) is longer " - "than the time between snapshots (dt=%e)", - i, e->snapshot_recording_triggers_part[i], snapshot_delta); - } - } - - /* Verify the spart triggers */ - for (int i = 0; i < num_snapshot_triggers_spart; ++i) { - if (e->snapshot_recording_triggers_spart[i] > snapshot_delta) { - error( - "The recording time for the spart trigger %d (dt=%e) is longer " - "than the time between snapshots (dt=%e)", - i, e->snapshot_recording_triggers_spart[i], snapshot_delta); - } - } - - /* Verify the bpart triggers */ - for (int i = 0; i < num_snapshot_triggers_bpart; ++i) { - if (e->snapshot_recording_triggers_bpart[i] > snapshot_delta) { - error( - "The recording time for the bpart trigger %d (dt=%e) is longer " - "than the time between snapshots (dt=%e)", - i, e->snapshot_recording_triggers_bpart[i], snapshot_delta); - } - } -} - -/** - * @brief Verify that the triggers provided by the user are not - * overlapping with the snapshot times. - * - * Deals witht the case of a regular snapshot pattern and output list. - * - * @param e The #engine. - */ -void engine_io_verify_triggers_size(const struct engine *e) { - - /* Stop if we have nothing to do */ - if (num_snapshot_triggers_part == 0 && num_snapshot_triggers_spart == 0 && - num_snapshot_triggers_bpart == 0) - return; - - if (e->output_list_snapshots) { - - /* Case where an output list is used */ - - if (e->policy & engine_policy_cosmology) { - - /* Loop over all the snapshot gaps */ - for (size_t i = 0; i < e->output_list_snapshots->size - 1; ++i) { - - const double a = e->output_list_snapshots->times[i]; - const double a_next = e->output_list_snapshots->times[i + 1]; - - const double snapshot_delta = - cosmology_get_delta_time_from_scale_factors(e->cosmology, a, - a_next); - /* Do the verification */ - check_triggers(e, snapshot_delta); - } - - /* Also verify what happens before the first snapshot */ - const double snapshot_delta_first = - cosmology_get_delta_time_from_scale_factors( - e->cosmology, e->time_begin, e->output_list_snapshots->times[0]); - - /* Do the verification */ - check_triggers(e, snapshot_delta_first); - - } else { - - /* Loop over all the snapshot gaps */ - for (size_t i = 0; i < e->output_list_snapshots->size - 1; ++i) { - - const double time = e->output_list_snapshots->times[i]; - const double time_next = e->output_list_snapshots->times[i + 1]; - - const double snapshot_delta = time_next - time; - - /* Do the verification */ - check_triggers(e, snapshot_delta); - } - - /* Also verify what happens before the first snapshot */ - const double snapshot_delta_first = - e->output_list_snapshots->times[0] - e->time_begin; - - /* Do the verification */ - check_triggers(e, snapshot_delta_first); - } - - } else { - - /* Case where we have a regular pattern */ - - if (e->policy & engine_policy_cosmology) { - - /* Loop over all the snapshot gaps */ - for (double a = e->a_first_snapshot; a <= e->time_end; - a *= e->delta_time_snapshot) { - - const double a_next = a * e->delta_time_snapshot; - const double snapshot_delta = - cosmology_get_delta_time_from_scale_factors(e->cosmology, a, - a_next); - - /* Do the verification */ - check_triggers(e, snapshot_delta); - } - - /* Also verify what happens before the first snapshot */ - const double snapshot_delta_first = - cosmology_get_delta_time_from_scale_factors( - e->cosmology, e->time_begin, e->a_first_snapshot); - - /* Do the verification */ - check_triggers(e, snapshot_delta_first); - - } else { - - /* Simplest case: the delta is constant */ - const double snapshot_delta = e->delta_time_snapshot; - - /* Do the verification */ - check_triggers(e, snapshot_delta); - - /* Also verify what happens before the first snapshot */ - const double snapshot_delta_first = - e->time_first_snapshot - e->time_begin; - - /* Do the verification */ - check_triggers(e, snapshot_delta_first); - } - } -}