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:
@ -49,24 +49,6 @@ namespace Foam
|
||||
|
||||
bool Foam::surfMeshSamplers::verbose_ = false;
|
||||
|
||||
void Foam::surfMeshSamplers::checkOutNames
|
||||
(
|
||||
const objectRegistry& registry,
|
||||
const UList<word>& names
|
||||
)
|
||||
{
|
||||
objectRegistry& reg = const_cast<objectRegistry&>(registry);
|
||||
|
||||
for (const word& fldName : names)
|
||||
{
|
||||
objectRegistry::iterator iter = reg.find(fldName);
|
||||
if (iter.found())
|
||||
{
|
||||
registry.checkOut(*iter());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
@ -297,7 +279,11 @@ bool Foam::surfMeshSamplers::execute()
|
||||
}
|
||||
}
|
||||
|
||||
checkOutNames(db, cleanup);
|
||||
// Cleanup any locally introduced names
|
||||
for (const word& fieldName : cleanup)
|
||||
{
|
||||
db.checkOut(fieldName);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -157,14 +157,6 @@ class surfMeshSamplers
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Remove items by name from objectRegistry
|
||||
static void checkOutNames
|
||||
(
|
||||
const objectRegistry& registry,
|
||||
const UList<word>& names
|
||||
);
|
||||
|
||||
|
||||
//- Hard-coded derived field (rho * U)
|
||||
// \return true if field did not previously exist
|
||||
bool add_rhoU(const word& derivedName);
|
||||
|
||||
Reference in New Issue
Block a user