functionObjects: Simplified and reorganised using the fieldExpression base-class

This commit is contained in:
Henry Weller
2016-05-21 20:10:47 +01:00
parent 3009367a88
commit 546159a86c
14 changed files with 50 additions and 101 deletions

View File

@ -42,10 +42,14 @@ Foam::functionObjects::fieldExpression::fieldExpression
(
const word& name,
const Time& runTime,
const dictionary& dict
const dictionary& dict,
const word& fieldName,
const word& resultName
)
:
fvMeshFunctionObject(name, runTime, dict)
fvMeshFunctionObject(name, runTime, dict),
fieldName_(fieldName),
resultName_(resultName)
{
read(dict);
}
@ -61,7 +65,10 @@ Foam::functionObjects::fieldExpression::~fieldExpression()
bool Foam::functionObjects::fieldExpression::read(const dictionary& dict)
{
dict.lookup("field") >> fieldName_;
if (fieldName_ == word::null || dict.found("field"))
{
dict.lookup("field") >> fieldName_;
}
if (dict.found("result"))
{

View File

@ -93,7 +93,9 @@ public:
(
const word& name,
const Time& runTime,
const dictionary& dict
const dictionary& dict,
const word& fieldName = word::null,
const word& resultName = word::null
);