BUG: removed stickiness of readFields function object in postProcess mode. Fixes #2647

This commit is contained in:
Andrew Heather
2022-11-30 10:33:53 +00:00
parent 8495b86d8e
commit 0b83d39500

View File

@ -80,16 +80,29 @@ bool Foam::functionObjects::readFields::execute()
for (const word& fieldName : fieldSet_) for (const word& fieldName : fieldSet_)
{ {
// Already loaded? // Already loaded?
const auto* ptr = mesh_.cfindObject<regIOobject>(fieldName); auto* ptr = mesh_.getObjectPtr<regIOobject>(fieldName);
if (ptr) if (ptr)
{
if (functionObject::postProcess)
{
DebugInfo
<< "readFields : "
<< ptr->name() << " (" << ptr->type()
<< ") already in database - removing" << endl;
ptr->checkOut();
}
else
{ {
DebugInfo DebugInfo
<< "readFields : " << "readFields : "
<< ptr->name() << " (" << ptr->type() << ptr->name() << " (" << ptr->type()
<< ") already in database" << endl; << ") already in database" << endl;
continue; continue;
} }
}
// Load field as necessary // Load field as necessary
IOobject io IOobject io