functionObjects: Added fields() function to provide list of required fields to postProcess
With this change each functionObject provides the list of fields required so that the postProcess utility can pre-load them before executing the list of functionObjects. This provides a more convenient interface than using the -field or -fields command-line options to postProcess which are now redundant.
This commit is contained in:
@ -123,6 +123,12 @@ bool Foam::functionObjects::fieldsExpression::read(const dictionary& dict)
|
||||
}
|
||||
|
||||
|
||||
Foam::wordList Foam::functionObjects::fieldsExpression::fields() const
|
||||
{
|
||||
return fieldNames_;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjects::fieldsExpression::execute()
|
||||
{
|
||||
if (!calc())
|
||||
|
||||
@ -170,6 +170,9 @@ public:
|
||||
//- Read the fieldsExpression data
|
||||
virtual bool read(const dictionary&);
|
||||
|
||||
//- Return the list of fields required
|
||||
virtual wordList fields() const;
|
||||
|
||||
//- Calculate the result fields
|
||||
virtual bool execute();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user