From 51c367fea05d5c7371d89aa2709fb5b685939b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domokos=20S=C3=A1rm=C3=A1ny?= Date: Tue, 26 Nov 2024 15:45:51 +0100 Subject: [PATCH] Change logic whether to skip first step arriving --- src/multio/action/statistics/Statistics.cc | 23 +++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/multio/action/statistics/Statistics.cc b/src/multio/action/statistics/Statistics.cc index 12f50afa..de9e3832 100644 --- a/src/multio/action/statistics/Statistics.cc +++ b/src/multio/action/statistics/Statistics.cc @@ -332,23 +332,28 @@ void Statistics::executeImpl(message::Message msg) { // TODO: Reorganize the code to avoid this second search // which is not efficient stat = fieldStats_.find(key); + if (opt_.solver_send_initial_condition()) { + return; + } } - - // Exit if the current time is the same as the current point in the - // window and the solver does not send the initial condition. - // This can happen when the solver is sending the initial condition - // and and the same point is already present in the restart - auto& ts = *(stat->second); - if ( cfg.curr() == ts.cwin().currPoint() && opt_.solver_send_initial_condition() ) { - return; + else { + // Exit if the current time is the same as the current point in the + // window and the solver does not send the initial condition. + // This can happen when the solver is sending the initial condition + // and and the same point is already present in the restart + auto& ts = *(stat->second); + + if (cfg.curr() == ts.cwin().currPoint() && opt_.solver_send_initial_condition()) { + return; + } } - // std::ostringstream os; // os << "Current time vs current point in the window :: " // << cfg.curr() << " " << ts.cwin().currPoint() // << std::endl; // std::cout << os.str() << std::endl; + auto& ts = *(stat->second); // In any case if the current time is greater than the current point in the window, we have a problem if ( cfg.curr() <= ts.cwin().currPoint() ) { std::ostringstream os;