functionObject::fieldExpression: Corrected construction of the result field name

This commit is contained in:
Henry Weller
2019-11-28 19:03:05 +00:00
parent a2bb959e23
commit ffb65bcee5
12 changed files with 36 additions and 34 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -41,20 +41,20 @@ namespace functionObjects
void Foam::functionObjects::fieldsExpression::setResultName
(
const word& typeName,
const wordList& defaultArgs
const word& functionName,
const wordList& defaultFieldNames
)
{
if (fieldNames_.empty())
{
fieldNames_ = defaultArgs;
fieldNames_ = defaultFieldNames;
}
if (resultName_.empty())
{
if (!fieldNames_.empty())
{
resultName_ = typeName + '(' + fieldNames_[0];
resultName_ = functionName + '(' + fieldNames_[0];
for (label i=1; i<fieldNames_.size(); i++)
{
resultName_ += ',' + fieldNames_[i];
@ -63,7 +63,7 @@ void Foam::functionObjects::fieldsExpression::setResultName
}
else
{
resultName_ = typeName;
resultName_ = functionName;
}
}
}