Commit 129532cb authored by Henry Weller's avatar Henry Weller
Browse files

functionObjects::Q: Result field named "Q" if the field is "U" otherwise "Q(<fieldName>)"

parent f4ecb2ff
......@@ -34,6 +34,7 @@ histogram/histogram.C
fieldExpression/fieldExpression.C
components/components.C
randomise/randomise.C
div/div.C
grad/grad.C
mag/mag.C
......
......@@ -77,8 +77,20 @@ Foam::functionObjects::Q::Q
const dictionary& dict
)
:
fieldExpression(name, runTime, dict, "U", "Q")
{}
fieldExpression(name, runTime, dict, "U")
{
if (resultName_.empty())
{
if (fieldName_ != "U")
{
resultName_ = "Q(" + fieldName_ + ')';
}
else
{
resultName_ = 'Q';
}
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
......
......@@ -77,7 +77,7 @@ bool Foam::functionObjects::fieldExpression::read(const dictionary& dict)
{
fvMeshFunctionObject::read(dict);
if (fieldName_ == word::null || dict.found("field"))
if (fieldName_.empty() || dict.found("field"))
{
dict.lookup("field") >> fieldName_;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment