From aa965f66120baaa6ef636d65fbede0756577f8ce Mon Sep 17 00:00:00 2001 From: Henry Date: Sun, 26 Apr 2015 21:34:27 +0100 Subject: [PATCH] faceSource: Changed option to write faceSource area to 'writeArea' --- .../field/fieldValues/faceSource/faceSource.C | 10 ++++++---- .../field/fieldValues/faceSource/faceSource.H | 7 ++++--- .../field/fieldValues/faceSource/faceSourceTemplates.C | 3 +-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C index 44e578b7e5..1fdfa478e2 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C @@ -399,6 +399,8 @@ Foam::scalar Foam::fieldValues::faceSource::totalArea() const void Foam::fieldValues::faceSource::initialise(const dictionary& dict) { + dict.lookup("sourceName") >> sourceName_; + switch (source_) { case stFaceZone: @@ -533,9 +535,9 @@ void Foam::fieldValues::faceSource::writeFileHeader(const label i) file() << nFaces_ << endl; writeCommented(file(), "Area : "); file() << totalArea() << endl; - writeCommented(file(), "Time"); - if (writeTotalArea_) + writeCommented(file(), "Time"); + if (writeArea_) { file() << tab << "Area"; } @@ -639,13 +641,13 @@ Foam::fieldValues::faceSource::faceSource : fieldValue(name, obr, dict, typeName, loadFromFiles), surfaceWriterPtr_(NULL), - writeTotalArea_(dict.lookupOrDefault("writeTotalArea", false)), source_(sourceTypeNames_.read(dict.lookup("source"))), operation_(operationTypeNames_.read(dict.lookup("operation"))), weightFieldName_("none"), orientWeightField_(false), orientedFieldsStart_(labelMax), scaleFactor_(1.0), + writeArea_(dict.lookupOrDefault("writeArea", false)), nFaces_(0), faceId_(), facePatchId_(), @@ -690,7 +692,7 @@ void Foam::fieldValues::faceSource::write() file() << obr_.time().value(); } - if (writeTotalArea_) + if (writeArea_) { if (Pstream::master()) { diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H index 4750be190f..9932b82015 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H @@ -66,6 +66,7 @@ Description type | type name: faceSource | yes | log | write data to standard output | no | no valueOutput | write the output values | yes | + writeArea | Write the area of the faceSource | no | surfaceFormat | output value format | no | source | face source: see below | yes | sourceName | name of face source if required | no | @@ -239,9 +240,6 @@ protected: //- Surface writer autoPtr surfaceWriterPtr_; - //- Optionally write the totalArea - bool writeTotalArea_; - //- Source type sourceType source_; @@ -260,6 +258,9 @@ protected: //- Scale factor - optional scalar scaleFactor_; + //- Optionally write the area of the faceSource + bool writeArea_; + //- Global number of faces label nFaces_; diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C index ec5b89345d..ce0142d590 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C @@ -354,7 +354,7 @@ bool Foam::fieldValues::faceSource::writeValues file()<< tab << result; Info(log_)<< " " << operationTypeNames_[operation_] - << "(" << sourceName_ << ") for " << fieldName + << "(" << sourceName_ << ") of " << fieldName << " = " << result << endl; } } @@ -447,4 +447,3 @@ Foam::tmp > Foam::fieldValues::faceSource::filterField // ************************************************************************* // -