Skip to content
Snippets Groups Projects
Commit 0b83d395 authored by Andrew Heather's avatar Andrew Heather
Browse files

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

parent 8495b86d
No related branches found
No related tags found
No related merge requests found
...@@ -80,15 +80,28 @@ bool Foam::functionObjects::readFields::execute() ...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment