Commit f431a328 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: volRegion and volFieldValue - updated output name if operating on all cells

parent 0a49f3ef
......@@ -83,6 +83,7 @@ Foam::functionObjects::volRegion::volRegion
? regionTypeNames_.read(dict.lookup("regionType"))
: vrtAll
),
regionName_(polyMesh::defaultRegion),
regionID_(-1)
{
read(dict);
......
......@@ -217,12 +217,17 @@ bool Foam::functionObjects::fieldValues::volFieldValue::writeValues
if (Pstream::master())
{
word outName = fieldName + '_' + regionTypeNames_[regionType_];
if (this->volRegion::regionName_ != polyMesh::defaultRegion)
{
outName = outName + '-' + this->volRegion::regionName_;
}
IOField<Type>
(
IOobject
(
fieldName + '_' + regionTypeNames_[regionType_]
+ '-' + volRegion::regionName_,
outName,
obr_.time().timeName(),
obr_,
IOobject::NO_READ,
......@@ -241,13 +246,17 @@ bool Foam::functionObjects::fieldValues::volFieldValue::writeValues
file()<< tab << result;
Log << " " << operationTypeNames_[operation_]
<< "(" << volRegion::regionName_ << ") of " << fieldName
<< "(" << this->volRegion::regionName_ << ") of " << fieldName
<< " = " << result << endl;
// Write state/results information
const word& opName = operationTypeNames_[operation_];
word resultName =
opName + '(' + volRegion::regionName_ + ',' + fieldName + ')';
word outName = fieldName;
if (this->volRegion::regionName_ != polyMesh::defaultRegion)
{
outName = this->volRegion::regionName_ + ',' + outName;
}
word resultName = opName + '(' + outName + ')';
this->setResult(resultName, result);
}
......
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