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,15 +80,28 @@ 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)
{ {
DebugInfo if (functionObject::postProcess)
<< "readFields : " {
<< ptr->name() << " (" << ptr->type() DebugInfo
<< ") already in database" << endl; << "readFields : "
continue; << ptr->name() << " (" << ptr->type()
<< ") already in database - removing" << endl;
ptr->checkOut();
}
else
{
DebugInfo
<< "readFields : "
<< ptr->name() << " (" << ptr->type()
<< ") already in database" << endl;
continue;
}
} }
// Load field as necessary // Load field as necessary