Skip to content
Snippets Groups Projects
Commit 5205dc73 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[NL] FixedTS; accumulate same errors as in sim

In the simulation the time is computed by adding increments
(t += dt), which leads to accumulation of small error.
This error might be significant. Repeating same "mistakes"
here to avoid differences.
parent cea2ceb0
No related branches found
No related tags found
No related merge requests found
......@@ -192,7 +192,11 @@ std::unique_ptr<TimeStepAlgorithm> createFixedTimeStepping(
e.what());
}
t_curr += repeat * delta_t;
// Multiplying dt * repeat is not the same as in the current
// implementation of the time loop, where the dt's are added.
// Therefore the sum of all dt is taken here.
t_curr =
std::accumulate(end(delta_ts) - repeat, end(delta_ts), t_curr);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment