Skip to content
Snippets Groups Projects
Commit 30512ec1 authored by Mattijs Janssens's avatar Mattijs Janssens
Browse files

correcting interval dumping when changing dump interval

parent 6ce182a3
No related branches found
No related tags found
No related merge requests found
...@@ -44,6 +44,7 @@ void Foam::Time::readDict() ...@@ -44,6 +44,7 @@ void Foam::Time::readDict()
); );
} }
scalar oldWriteInterval = writeInterval_;
if (controlDict_.readIfPresent("writeInterval", writeInterval_)) if (controlDict_.readIfPresent("writeInterval", writeInterval_))
{ {
if (writeControl_ == wcTimeStep && label(writeInterval_) < 1) if (writeControl_ == wcTimeStep && label(writeInterval_) < 1)
...@@ -58,6 +59,22 @@ void Foam::Time::readDict() ...@@ -58,6 +59,22 @@ void Foam::Time::readDict()
controlDict_.lookup("writeFrequency") >> writeInterval_; controlDict_.lookup("writeFrequency") >> writeInterval_;
} }
if (oldWriteInterval != writeInterval_)
{
switch(writeControl_)
{
case wcRunTime:
case wcAdjustableRunTime:
// Recalculate outputTimeIndex_ to be in units of current
// writeInterval.
outputTimeIndex_ *= oldWriteInterval/writeInterval_;
break;
default:
break;
}
}
if (controlDict_.readIfPresent("purgeWrite", purgeWrite_)) if (controlDict_.readIfPresent("purgeWrite", purgeWrite_))
{ {
if (purgeWrite_ < 0) if (purgeWrite_ < 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment