ENH: improve missing entry message for Function1 or PatchFunction1

- now indicate that the dictionary entry is missing, not that it is
  an unknown function type.

STYLE: adjust PatchFunction1New.C to have logic structure look similar
This commit is contained in:
Mark Olesen
2019-11-18 15:34:52 +01:00
committed by Andrew Heather
parent bc8343f702
commit 7c2ad98834
2 changed files with 12 additions and 9 deletions

View File

@ -42,15 +42,17 @@ Foam::autoPtr<Foam::Function1<Type>> Foam::Function1<Type>::New
const entry* eptr = dict.findEntry(entryName, keyType::LITERAL);
if (!eptr && modelType.empty())
if (!eptr)
{
FatalIOErrorInFunction(dict)
<< "No Function1 dictionary entry: "
<< entryName << nl << nl
<< exit(FatalIOError);
if (modelType.empty())
{
FatalIOErrorInFunction(dict)
<< "No Function1 dictionary entry: "
<< entryName << nl << nl
<< exit(FatalIOError);
}
}
if (eptr->isDict())
else if (eptr->isDict())
{
const dictionary& coeffsDict = eptr->dict();