From cd1ddfa16a4e1f8e017c3a371f4e52b31d9ce949 Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 20 Jun 2023 15:26:59 +0200 Subject: [PATCH] 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 --- .../writeLiggghts/writeLiggghts.C | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/lagrangian/cfdemParticle/subModels/liggghtsCommandModel/writeLiggghts/writeLiggghts.C b/src/lagrangian/cfdemParticle/subModels/liggghtsCommandModel/writeLiggghts/writeLiggghts.C index ebed180d..81ee0cc2 100644 --- a/src/lagrangian/cfdemParticle/subModels/liggghtsCommandModel/writeLiggghts/writeLiggghts.C +++ b/src/lagrangian/cfdemParticle/subModels/liggghtsCommandModel/writeLiggghts/writeLiggghts.C @@ -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); }