ENH: IOobject headerClassName now initialised to empty value

- was previously populated with "IOobject" (the typeName) but then
  cannot easily detect if the object was actually read.
  Also clear the headerClassName on a failed read

BUG: parallel inconsistency in regIOobject::readHeaderOk

- headerOk() checked with master, but possible parallel operations
  within it
This commit is contained in:
mattijs
2022-11-08 11:17:46 +00:00
committed by Mark Olesen
parent e401e8f132
commit 69be54107d
4 changed files with 17 additions and 15 deletions

View File

@ -272,18 +272,18 @@ void evaluate
);
io.typeHeaderOk<IOobject>(false);
oldFieldType = io.headerClassName();
if (oldFieldType == IOobject::typeName)
if (!io.hasHeaderClass() || io.isHeaderClass<IOobject>())
{
FatalErrorInFunction
<< "Field " << fieldName << "(type: " << oldFieldType
<< ") seems to be missing. Use 'create'" << nl
<< "Field '" << fieldName
<< "' seems to be missing. Use 'create'" << nl
<< exit(FatalError);
}
oldFieldType = io.headerClassName();
Info<< "Modify field: " << fieldName
<< " (type " << oldFieldType << ')';
<< " (type: " << oldFieldType << ')';
}