From 942b2e946a0c1c00fe38f2a2ab028e137f7af57f Mon Sep 17 00:00:00 2001 From: Liang Wang Date: Mon, 17 Jul 2023 10:27:39 -0400 Subject: [PATCH] io: rm unused tfield_average_length --- src/include/OutputFieldsDefault.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/include/OutputFieldsDefault.h b/src/include/OutputFieldsDefault.h index d3ff048462..907acf2e56 100644 --- a/src/include/OutputFieldsDefault.h +++ b/src/include/OutputFieldsDefault.h @@ -70,7 +70,6 @@ struct OutputFieldsItemParams int pfield_first = 0; int tfield_interval = 0; int tfield_first = 0; - int tfield_average_length = 1000000; int tfield_average_every = 1; Int3 rn = {}; Int3 rx = {10000000, 10000000, 10000000}; @@ -114,16 +113,18 @@ class OutputFieldsItem : public OutputFieldsItemParams if (timestep != 0) { pfield_next_ = timestep + pfield_interval; tfield_next_ = timestep + tfield_interval; + + tfield_next_ = timestep / tfield_interval * tfield_interval; + if (timestep % tfield_interval > 0) + tfield_next_ += tfield_interval; } } bool do_pfield = pfield_interval > 0 && timestep >= pfield_next_; bool do_tfield = tfield_interval > 0 && timestep >= tfield_next_; - bool doaccum_tfield = - tfield_interval > 0 && - (((timestep >= (tfield_next_ - tfield_average_length + 1)) && - timestep % tfield_average_every == 0) || - timestep == 0); + bool doaccum_tfield = timestep >= (tfield_next_ - tfield_average_every + 1); + doaccum_tfield = doaccum_tfield && (tfield_interval > 0); + doaccum_tfield = doaccum_tfield || (timestep == 0); if (do_pfield || doaccum_tfield) { prof_start(pr_eval);