writeTime() not 'triggered' for start time
Got this during #2786
The constructor of DarcyForchheimer calls a function that has a section (see attached patch) that writes additional fields if
- the debug-flag is set and
- it is a "write time" (the
Time::writeTime()
method returnstrue
) At the time of construction condition 2 is not true and as this is the only time the method is called the fields are never written
The attached patch fixes this by checking whether the timeIndex()
is the index at startup
I don't think that this particular bug is a problem for many people but it could point to some other similar problems: maybe the semantics of writeTime()
were different at the time this class was written (otherwise the fields would have never been written) and there are other places where people expect debug-data but never get it.
Wouldn't suggest changing writeTime()
(again?) but making the (in this case) expected behaviour available through a separate method (writeTimeOrStartTime()
for instance) or making it switchable with a default to the current behaviour(bool writeTime(bool or_start_time=false) const;
) and change the other debug && writeTime()
in the code if appropriate