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:
Will Bainbridge
2021-01-22 10:34:37 +00:00
parent 4e301e9227
commit 3ca14ebe58
24 changed files with 99 additions and 100 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -415,7 +415,6 @@ Foam::functionObjects::sizeDistribution::sizeDistribution
binCmpt_(0) binCmpt_(0)
{ {
read(dict); read(dict);
resetName(name);
switch (coordinateType_) switch (coordinateType_)
{ {
@ -466,6 +465,8 @@ bool Foam::functionObjects::sizeDistribution::read(const dictionary& dict)
geometric_ = dict.lookupOrDefault<Switch>("geometric", false); geometric_ = dict.lookupOrDefault<Switch>("geometric", false);
maxOrder_ = dict.lookupOrDefault("maxOrder", 3); maxOrder_ = dict.lookupOrDefault("maxOrder", 3);
resetName(name());
return false; return false;
} }

View File

@ -33,14 +33,13 @@ void Foam::functionObjects::logFiles::createFiles()
{ {
if (Pstream::master()) if (Pstream::master())
{ {
const word startTimeName = const word timeName = fileObr_.time().timeName();
fileObr_.time().timeName(fileObr_.time().startTime().value());
forAll(names_, i) forAll(names_, i)
{ {
if (!filePtrs_.set(i)) if (!filePtrs_.set(i))
{ {
const fileName outputDir(baseFileDir()/prefix_/startTimeName); const fileName outputDir(baseFileDir()/prefix_/timeName);
mkDir(outputDir); mkDir(outputDir);
filePtrs_.set(i, new OFstream(outputDir/(names_[i] + ".dat"))); filePtrs_.set(i, new OFstream(outputDir/(names_[i] + ".dat")));
initStream(filePtrs_[i]); initStream(filePtrs_[i]);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -41,19 +41,19 @@ namespace functionObjects
// * * * * * * * * * * * * * * * Private Members * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Private Members * * * * * * * * * * * * * * //
void Foam::functionObjects::timeControl::readControls() void Foam::functionObjects::timeControl::readControls(const dictionary& dict)
{ {
if (!dict_.readIfPresent("startTime", startTime_)) if (!dict.readIfPresent("startTime", startTime_))
{ {
dict_.readIfPresent("timeStart", startTime_); dict.readIfPresent("timeStart", startTime_);
} }
if (!dict_.readIfPresent("endTime", endTime_)) if (!dict.readIfPresent("endTime", endTime_))
{ {
dict_.readIfPresent("timeEnd", endTime_); dict.readIfPresent("timeEnd", endTime_);
} }
dict_.readIfPresent("nStepsToStartTimeChange", nStepsToStartTimeChange_); dict.readIfPresent("nStepsToStartTimeChange", nStepsToStartTimeChange_);
} }
@ -76,7 +76,6 @@ Foam::functionObjects::timeControl::timeControl
: :
functionObject(name), functionObject(name),
time_(t), time_(t),
dict_(dict),
startTime_(-vGreat), startTime_(-vGreat),
endTime_(vGreat), endTime_(vGreat),
nStepsToStartTimeChange_ nStepsToStartTimeChange_
@ -85,9 +84,9 @@ Foam::functionObjects::timeControl::timeControl
), ),
executeControl_(t, dict, "execute"), executeControl_(t, dict, "execute"),
writeControl_(t, dict, "write"), writeControl_(t, dict, "write"),
foPtr_(functionObject::New(name, t, dict_)) foPtr_(functionObject::New(name, t, dict))
{ {
readControls(); read(dict);
} }
@ -174,32 +173,23 @@ Foam::scalar Foam::functionObjects::timeControl::timeToNextWrite()
} }
bool Foam::functionObjects::timeControl::read bool Foam::functionObjects::timeControl::read(const dictionary& dict)
(
const dictionary& dict
)
{ {
if (dict != dict_) writeControl_.read(dict);
{ executeControl_.read(dict);
dict_ = dict;
writeControl_.read(dict); readControls(dict);
executeControl_.read(dict);
readControls();
return true; if (active())
}
else
{ {
return false; foPtr_->read(dict);
} }
return true;
} }
void Foam::functionObjects::timeControl::updateMesh void Foam::functionObjects::timeControl::updateMesh(const mapPolyMesh& mpm)
(
const mapPolyMesh& mpm
)
{ {
if (active()) if (active())
{ {
@ -208,10 +198,7 @@ void Foam::functionObjects::timeControl::updateMesh
} }
void Foam::functionObjects::timeControl::movePoints void Foam::functionObjects::timeControl::movePoints(const polyMesh& mesh)
(
const polyMesh& mesh
)
{ {
if (active()) if (active())
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -64,9 +64,6 @@ class timeControl
//- Reference to the time database //- Reference to the time database
const Time& time_; const Time& time_;
//- Input dictionary
dictionary dict_;
// Optional user inputs // Optional user inputs
@ -94,7 +91,7 @@ class timeControl
// Private Member Functions // Private Member Functions
//- Read relevant dictionary entries //- Read relevant dictionary entries
void readControls(); void readControls(const dictionary& dict);
//- Returns true if within time bounds //- Returns true if within time bounds
bool active() const; bool active() const;
@ -127,9 +124,6 @@ public:
//- Return time database //- Return time database
inline const Time& time() const; inline const Time& time() const;
//- Return the input dictionary
inline const dictionary& dict() const;
//- Return the execute control object //- Return the execute control object
inline const Foam::timeControl& executeControl() const; inline const Foam::timeControl& executeControl() const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -31,12 +31,6 @@ inline const Foam::Time& Foam::functionObjects::timeControl::time() const
} }
inline const Foam::dictionary& Foam::functionObjects::timeControl::dict() const
{
return dict_;
}
inline const Foam::timeControl& inline const Foam::timeControl&
Foam::functionObjects::timeControl::executeControl() const Foam::functionObjects::timeControl::executeControl() const
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -110,7 +110,6 @@ Foam::functionObjects::fieldMinMax::fieldMinMax
fieldSet_() fieldSet_()
{ {
read(dict); read(dict);
resetName(typeName);
} }
@ -131,6 +130,8 @@ bool Foam::functionObjects::fieldMinMax::read(const dictionary& dict)
mode_ = modeTypeNames_[dict.lookupOrDefault<word>("mode", "magnitude")]; mode_ = modeTypeNames_[dict.lookupOrDefault<word>("mode", "magnitude")];
dict.lookup("fields") >> fieldSet_; dict.lookup("fields") >> fieldSet_;
resetName(typeName);
return true; return true;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -52,11 +52,11 @@ Foam::functionObjects::fieldValue::fieldValue
fvMeshFunctionObject(name, runTime, dict), fvMeshFunctionObject(name, runTime, dict),
logFiles(obr_, name), logFiles(obr_, name),
dict_(dict), dict_(dict),
valueType_(valueType),
regionName_(word::null), regionName_(word::null),
resultDict_(fileName("name"), dictionary::null) resultDict_(fileName("name"), dictionary::null)
{ {
read(dict); read(dict);
resetName(valueType);
} }
@ -71,11 +71,11 @@ Foam::functionObjects::fieldValue::fieldValue
fvMeshFunctionObject(name, obr, dict), fvMeshFunctionObject(name, obr, dict),
logFiles(obr_, name), logFiles(obr_, name),
dict_(dict), dict_(dict),
valueType_(valueType),
regionName_(word::null), regionName_(word::null),
resultDict_(fileName("name"), dictionary::null) resultDict_(fileName("name"), dictionary::null)
{ {
read(dict); read(dict);
resetName(valueType);
} }
@ -99,6 +99,8 @@ bool Foam::functionObjects::fieldValue::read(const dictionary& dict)
dict.lookup("fields") >> fields_; dict.lookup("fields") >> fields_;
dict.lookup("writeFields") >> writeFields_; dict.lookup("writeFields") >> writeFields_;
resetName(valueType_);
return true; return true;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -73,6 +73,9 @@ protected:
//- Construction dictionary //- Construction dictionary
dictionary dict_; dictionary dict_;
//- The name of the type of value (volFieldValue, or surfaceFieldValue)
const word valueType_;
//- Name of region (patch, zone, etc.) //- Name of region (patch, zone, etc.)
word regionName_; word regionName_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -113,7 +113,6 @@ Foam::functionObjects::fieldValues::fieldValueDelta::fieldValueDelta
region2Ptr_(nullptr) region2Ptr_(nullptr)
{ {
read(dict); read(dict);
resetName(typeName);
} }
@ -155,6 +154,8 @@ bool Foam::functionObjects::fieldValues::fieldValueDelta::read
operation_ = operationTypeNames_.read(dict.lookup("operation")); operation_ = operationTypeNames_.read(dict.lookup("operation"));
resetName(typeName);
return true; return true;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -224,7 +224,6 @@ Foam::functionObjects::interfaceHeight::interfaceHeight
interpolationScheme_("cellPoint") interpolationScheme_("cellPoint")
{ {
read(dict); read(dict);
resetNames({"height", "position"});
} }
@ -238,11 +237,15 @@ Foam::functionObjects::interfaceHeight::~interfaceHeight()
bool Foam::functionObjects::interfaceHeight::read(const dictionary& dict) bool Foam::functionObjects::interfaceHeight::read(const dictionary& dict)
{ {
fvMeshFunctionObject::read(dict);
dict.readIfPresent("alpha", alphaName_); dict.readIfPresent("alpha", alphaName_);
dict.readIfPresent("liquid", liquid_); dict.readIfPresent("liquid", liquid_);
dict.lookup("locations") >> locations_; dict.lookup("locations") >> locations_;
dict.readIfPresent("interpolationScheme", interpolationScheme_); dict.readIfPresent("interpolationScheme", interpolationScheme_);
resetNames({"height", "position"});
return true; return true;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2018-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -72,8 +72,6 @@ Foam::functionObjects::turbulenceIntensity::turbulenceIntensity
writeLocalObjects(obr_, log) writeLocalObjects(obr_, log)
{ {
read(dict); read(dict);
resetName(typeName);
resetLocalObjectName("I");
} }
@ -90,6 +88,9 @@ bool Foam::functionObjects::turbulenceIntensity::read(const dictionary& dict)
fvMeshFunctionObject::read(dict); fvMeshFunctionObject::read(dict);
writeLocalObjects::read(dict); writeLocalObjects::read(dict);
resetName(typeName);
resetLocalObjectName("I");
return true; return true;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -120,8 +120,6 @@ Foam::functionObjects::wallHeatFlux::wallHeatFlux
patchSet_() patchSet_()
{ {
read(dict); read(dict);
resetName(typeName);
resetLocalObjectName(typeName);
} }
@ -185,6 +183,9 @@ bool Foam::functionObjects::wallHeatFlux::read(const dictionary& dict)
patchSet_ = filteredPatchSet; patchSet_ = filteredPatchSet;
} }
resetName(typeName);
resetLocalObjectName(typeName);
return true; return true;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -76,15 +76,13 @@ Foam::functionObjects::wallHeatTransferCoeff::wallHeatTransferCoeff
fvMeshFunctionObject(name, runTime, dict), fvMeshFunctionObject(name, runTime, dict),
logFiles(obr_, name), logFiles(obr_, name),
writeLocalObjects(obr_, log), writeLocalObjects(obr_, log),
coeffModel_(wallHeatTransferCoeffModel::New(dict.name(), mesh_, dict)),
rho_("rho", dimDensity, Zero), rho_("rho", dimDensity, Zero),
Cp_("Cp", dimArea/sqr(dimTime)/dimTemperature, Zero), Cp_("Cp", dimArea/sqr(dimTime)/dimTemperature, Zero),
runTime_(runTime), runTime_(runTime),
patchSet_() patchSet_()
{ {
coeffModel_ = wallHeatTransferCoeffModel::New(dict.name(), mesh_, dict);
read(dict); read(dict);
resetName(typeName);
resetLocalObjectName(typeName);
} }
@ -162,6 +160,9 @@ bool Foam::functionObjects::wallHeatTransferCoeff::read(const dictionary& dict)
coeffModel_->read(dict); coeffModel_->read(dict);
resetName(typeName);
resetLocalObjectName(typeName);
return true; return true;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -105,8 +105,6 @@ Foam::functionObjects::wallShearStress::wallShearStress
patchSet_() patchSet_()
{ {
read(dict); read(dict);
resetName(typeName);
resetLocalObjectName(typeName);
} }
@ -170,6 +168,9 @@ bool Foam::functionObjects::wallShearStress::read(const dictionary& dict)
patchSet_ = filteredPatchSet; patchSet_ = filteredPatchSet;
} }
resetName(typeName);
resetLocalObjectName(typeName);
return true; return true;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -138,8 +138,6 @@ Foam::functionObjects::yPlus::yPlus
phaseName_(dict.lookupOrDefault<word>("phase", word::null)) phaseName_(dict.lookupOrDefault<word>("phase", word::null))
{ {
read(dict); read(dict);
resetName(IOobject::groupName(typeName, phaseName_));
resetLocalObjectName(IOobject::groupName(typeName, phaseName_));
} }
@ -156,6 +154,9 @@ bool Foam::functionObjects::yPlus::read(const dictionary& dict)
fvMeshFunctionObject::read(dict); fvMeshFunctionObject::read(dict);
writeLocalObjects::read(dict); writeLocalObjects::read(dict);
resetName(IOobject::groupName(typeName, phaseName_));
resetLocalObjectName(IOobject::groupName(typeName, phaseName_));
return true; return true;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -559,7 +559,6 @@ Foam::functionObjects::forces::forces
initialised_(false) initialised_(false)
{ {
read(dict); read(dict);
resetNames(createFileNames(dict));
} }
@ -594,7 +593,6 @@ Foam::functionObjects::forces::forces
initialised_(false) initialised_(false)
{ {
read(dict); read(dict);
resetNames(createFileNames(dict));
} }
@ -739,6 +737,8 @@ bool Foam::functionObjects::forces::read(const dictionary& dict)
moment_[2].setSize(1); moment_[2].setSize(1);
} }
resetNames(createFileNames(dict));
return true; return true;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -87,8 +87,6 @@ bool Foam::functionObjects::cloudInfo::read(const dictionary& dict)
{ {
regionFunctionObject::read(dict); regionFunctionObject::read(dict);
logFiles::resetNames(dict.lookup("clouds"));
Info<< type() << " " << name() << ": "; Info<< type() << " " << name() << ": ";
if (names().size()) if (names().size())
{ {
@ -104,6 +102,8 @@ bool Foam::functionObjects::cloudInfo::read(const dictionary& dict)
Info<< "no clouds to be processed" << nl << endl; Info<< "no clouds to be processed" << nl << endl;
} }
resetNames(dict.lookup("clouds"));
return true; return true;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -58,7 +58,6 @@ Foam::functionObjects::residuals::residuals
fieldSet_() fieldSet_()
{ {
read(dict); read(dict);
resetName(typeName);
} }
@ -76,6 +75,8 @@ bool Foam::functionObjects::residuals::read(const dictionary& dict)
dict.lookup("fields") >> fieldSet_; dict.lookup("fields") >> fieldSet_;
resetName(typeName);
return true; return true;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2018-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -61,8 +61,6 @@ Foam::functionObjects::time::time
clockTime0_(time_.elapsedClockTime()) clockTime0_(time_.elapsedClockTime())
{ {
read(dict); read(dict);
resetName(typeName);
write();
} }
@ -80,6 +78,8 @@ bool Foam::functionObjects::time::read(const dictionary& dict)
dict.readIfPresent("perTimeStep", perTimeStep_); dict.readIfPresent("perTimeStep", perTimeStep_);
resetName(typeName);
return true; return true;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -58,7 +58,6 @@ Foam::functionObjects::timeStep::timeStep
logFiles(obr_, name) logFiles(obr_, name)
{ {
read(dict); read(dict);
resetName(typeName);
} }
@ -74,6 +73,8 @@ bool Foam::functionObjects::timeStep::read(const dictionary& dict)
{ {
functionObject::read(dict); functionObject::read(dict);
resetName(typeName);
return true; return true;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2019-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -61,7 +61,6 @@ Foam::functionObjects::rigidBodyState::rigidBodyState
names_(motion().movingBodyNames()) names_(motion().movingBodyNames())
{ {
read(dict); read(dict);
resetNames(names_);
} }
@ -86,8 +85,11 @@ Foam::functionObjects::rigidBodyState::motion() const
bool Foam::functionObjects::rigidBodyState::read(const dictionary& dict) bool Foam::functionObjects::rigidBodyState::read(const dictionary& dict)
{ {
fvMeshFunctionObject::read(dict); fvMeshFunctionObject::read(dict);
angleFormat_ = dict.lookupOrDefault<word>("angleFormat", "radians"); angleFormat_ = dict.lookupOrDefault<word>("angleFormat", "radians");
resetNames(names_);
return true; return true;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2018-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -60,7 +60,6 @@ Foam::functionObjects::sixDoFRigidBodyControl::sixDoFRigidBodyControl
meanAngularVelocity_(Zero) meanAngularVelocity_(Zero)
{ {
read(dict); read(dict);
resetName(typeName);
} }
@ -80,6 +79,8 @@ bool Foam::functionObjects::sixDoFRigidBodyControl::read(const dictionary& dict)
dict.lookup("convergedVelocity") >> convergedVelocity_; dict.lookup("convergedVelocity") >> convergedVelocity_;
dict.lookup("convergedAngularVelocity") >> convergedAngularVelocity_; dict.lookup("convergedAngularVelocity") >> convergedAngularVelocity_;
resetName(typeName);
return true; return true;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -60,7 +60,6 @@ Foam::functionObjects::sixDoFRigidBodyState::sixDoFRigidBodyState
logFiles(obr_, name) logFiles(obr_, name)
{ {
read(dict); read(dict);
resetName(typeName);
} }
@ -75,8 +74,11 @@ Foam::functionObjects::sixDoFRigidBodyState::~sixDoFRigidBodyState()
bool Foam::functionObjects::sixDoFRigidBodyState::read(const dictionary& dict) bool Foam::functionObjects::sixDoFRigidBodyState::read(const dictionary& dict)
{ {
fvMeshFunctionObject::read(dict); fvMeshFunctionObject::read(dict);
angleFormat_ = dict.lookupOrDefault<word>("angleFormat", "radians"); angleFormat_ = dict.lookupOrDefault<word>("angleFormat", "radians");
resetName(typeName);
return true; return true;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -89,7 +89,7 @@ Foam::functionObjects::specieReactionRates::specieReactionRates
) )
) )
{ {
resetName("specieReactionRates"); read(dict);
} }
@ -103,7 +103,9 @@ Foam::functionObjects::specieReactionRates::~specieReactionRates()
bool Foam::functionObjects::specieReactionRates::read(const dictionary& dict) bool Foam::functionObjects::specieReactionRates::read(const dictionary& dict)
{ {
regionFunctionObject::read(dict); fvMeshFunctionObject::read(dict);
resetName("specieReactionRates");
return true; return true;
} }