diff --git a/src/functionObjects/field/readFields/readFields.C b/src/functionObjects/field/readFields/readFields.C index 79a085431a9f70d0f878464798d3129697d757e1..bd670217d3a29e94a096f053cf3e4878281b3a20 100644 --- a/src/functionObjects/field/readFields/readFields.C +++ b/src/functionObjects/field/readFields/readFields.C @@ -80,15 +80,28 @@ bool Foam::functionObjects::readFields::execute() for (const word& fieldName : fieldSet_) { // Already loaded? - const auto* ptr = mesh_.cfindObject<regIOobject>(fieldName); + auto* ptr = mesh_.getObjectPtr<regIOobject>(fieldName); if (ptr) { - DebugInfo - << "readFields : " - << ptr->name() << " (" << ptr->type() - << ") already in database" << endl; - continue; + if (functionObject::postProcess) + { + DebugInfo + << "readFields : " + << 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