functionObjects: Fixes to restart and run-time modification behaviour
All function objects now re-read as a result of run-time modifications to the system/controlDict. Function objects that write log files (via the logFiles class) will now generate a new postProcessing/<funcName>/<time> directory as a result of either restart or run-time modification. Log files will therefore never be overwritten by restart or run-time modification, except for when a case is restarted at the same time as a previous execution (e.g., repeated runs at the start time).
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -52,11 +52,11 @@ Foam::functionObjects::fieldValue::fieldValue
|
||||
fvMeshFunctionObject(name, runTime, dict),
|
||||
logFiles(obr_, name),
|
||||
dict_(dict),
|
||||
valueType_(valueType),
|
||||
regionName_(word::null),
|
||||
resultDict_(fileName("name"), dictionary::null)
|
||||
{
|
||||
read(dict);
|
||||
resetName(valueType);
|
||||
}
|
||||
|
||||
|
||||
@ -71,11 +71,11 @@ Foam::functionObjects::fieldValue::fieldValue
|
||||
fvMeshFunctionObject(name, obr, dict),
|
||||
logFiles(obr_, name),
|
||||
dict_(dict),
|
||||
valueType_(valueType),
|
||||
regionName_(word::null),
|
||||
resultDict_(fileName("name"), dictionary::null)
|
||||
{
|
||||
read(dict);
|
||||
resetName(valueType);
|
||||
}
|
||||
|
||||
|
||||
@ -99,6 +99,8 @@ bool Foam::functionObjects::fieldValue::read(const dictionary& dict)
|
||||
dict.lookup("fields") >> fields_;
|
||||
dict.lookup("writeFields") >> writeFields_;
|
||||
|
||||
resetName(valueType_);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -73,6 +73,9 @@ protected:
|
||||
//- Construction dictionary
|
||||
dictionary dict_;
|
||||
|
||||
//- The name of the type of value (volFieldValue, or surfaceFieldValue)
|
||||
const word valueType_;
|
||||
|
||||
//- Name of region (patch, zone, etc.)
|
||||
word regionName_;
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -113,7 +113,6 @@ Foam::functionObjects::fieldValues::fieldValueDelta::fieldValueDelta
|
||||
region2Ptr_(nullptr)
|
||||
{
|
||||
read(dict);
|
||||
resetName(typeName);
|
||||
}
|
||||
|
||||
|
||||
@ -155,6 +154,8 @@ bool Foam::functionObjects::fieldValues::fieldValueDelta::read
|
||||
|
||||
operation_ = operationTypeNames_.read(dict.lookup("operation"));
|
||||
|
||||
resetName(typeName);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user