functionObject: Improved incorrect and incomplete argument error messages

Both the functionObject call context (the command line for postProcess, and the
controlDict path for run-time post-precessing) and the configuration file
context where the arguments are substituted are now printed in the error
message, e.g.

    postProcess -func 'patchAverage(name=inlet, ields=(p U))'

generates the message

--> FOAM FATAL IO ERROR:
Essential value for keyword 'fields' not set in function entry
    patchAverage(name=inlet, ields=(p U))
    in command line postProcess -func patchAverage(name=inlet, ields=(p U))
    Placeholder value is <field_names>

file: /home/dm2/henry/OpenFOAM/OpenFOAM-dev/etc/caseDicts/postProcessing/surfaceFieldValue/patchAverage from line 13 to line 17.

and with the following in controlDict

functions
{
    #includeFunc patchAverage(name=inlet, ields=(p U))
}

generates the message

--> FOAM FATAL IO ERROR:
Essential value for keyword 'fields' not set in function entry
     patchAverage(name=inlet, ields=(p U))
    in file /home/dm2/henry/OpenFOAM/OpenFOAM-dev/tutorials/incompressible/pimpleFoam/RAS/pitzDaily/system/controlDict at line 55
    Placeholder value is <field_names>

file: /home/dm2/henry/OpenFOAM/OpenFOAM-dev/etc/caseDicts/postProcessing/surfaceFieldValue/patchAverage from line 13 to line 17.
This commit is contained in:
Henry Weller
2019-08-10 19:16:25 +01:00
parent 808e827d20
commit 81f9320119
16 changed files with 132 additions and 39 deletions

View File

@ -78,8 +78,10 @@ public:
//- Construct from keyword, parent dictionary and Istream
functionEntry(const word&, const dictionary&, Istream&);
//- Disallow default bitwise copy construction
functionEntry(const functionEntry&) = delete;
autoPtr<entry> clone(const dictionary&) const
{
return autoPtr<entry>(new functionEntry(*this));
}
// Member Function Selectors