mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: support objectRegistry::checkOut(const word& name)
- similar to what erase() does, but as a mutable operation (#1180)
- replace basicThermo lookupAndCheckout (commit 880c98757d) with
the new objectRegistry::checkOut() method.
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2011, 2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2011, 2017-2019 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
@ -152,7 +152,7 @@ void Foam::functionObjects::fieldAverageItem::evolve(const objectRegistry& obr)
|
||||
const word fieldName = windowFieldNames_.pop();
|
||||
|
||||
//Info<< "evolve: removing field: " << fieldName << endl;
|
||||
obr.checkOut(*obr[fieldName]);
|
||||
obr.checkOut(fieldName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -164,22 +164,19 @@ void Foam::functionObjects::fieldAverageItem::clear
|
||||
bool fullClean
|
||||
)
|
||||
{
|
||||
if (mean_ && obr.found(meanFieldName_))
|
||||
if (mean_)
|
||||
{
|
||||
obr.checkOut(*obr[meanFieldName_]);
|
||||
obr.checkOut(meanFieldName_);
|
||||
}
|
||||
|
||||
if (prime2Mean_ && obr.found(prime2MeanFieldName_))
|
||||
if (prime2Mean_)
|
||||
{
|
||||
obr.checkOut(*obr[prime2MeanFieldName_]);
|
||||
obr.checkOut(prime2MeanFieldName_);
|
||||
}
|
||||
|
||||
for (const word& fieldName : windowFieldNames_)
|
||||
{
|
||||
if (obr.found(fieldName))
|
||||
{
|
||||
obr.checkOut(*obr[fieldName]);
|
||||
}
|
||||
obr.checkOut(fieldName);
|
||||
}
|
||||
|
||||
if (totalTime_ < 0 || fullClean)
|
||||
|
||||
@ -46,11 +46,9 @@ namespace functionObjects
|
||||
|
||||
void Foam::functionObjects::momentum::purgeFields()
|
||||
{
|
||||
objectRegistry& obr = const_cast<objectRegistry&>(obr_);
|
||||
|
||||
obr.erase(scopedName("momentum"));
|
||||
obr.erase(scopedName("angularMomentum"));
|
||||
obr.erase(scopedName("angularVelocity"));
|
||||
obr_.checkOut(scopedName("momentum"));
|
||||
obr_.checkOut(scopedName("angularMomentum"));
|
||||
obr_.checkOut(scopedName("angularVelocity"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user