make sure restart file is written if end time changes

if the OF end time gets modified at runtime, we need to update the time
setting for invoking the write_restart command if we only want to write
at the end of the simulation;
otherwise we will either write the file too soon or - probably even
worse - not at all
This commit is contained in:
danielque
2023-06-20 15:26:59 +02:00
parent bc73bd7506
commit cd1ddfa16a

View File

@ -138,6 +138,19 @@ const char* writeLiggghts::command(int commandLine)
bool writeLiggghts::runCommand(int couplingStep)
{
if (!overwrite_) strCommand_ = addTimeStamp(command_);
// update time settings if restart file is only written at last step and
// end time has changed
if
(
runLast_
&& particleCloud_.mesh().time().runTimeModifiable()
&& particleCloud_.mesh().time().endTime().value() != endTime_
)
{
checkTimeSettings(dict_);
}
return runThisCommand(couplingStep);
}