diff --git a/src/postProcessing/functionObjects/IO/removeRegisteredObject/removeRegisteredObject.C b/src/postProcessing/functionObjects/IO/removeRegisteredObject/removeRegisteredObject.C index eb4f5ee21a85db45eba0a2d9df92e45f4c7fa0c2..28bb18292eb5ba423f00f42f863c8b04f797a651 100644 --- a/src/postProcessing/functionObjects/IO/removeRegisteredObject/removeRegisteredObject.C +++ b/src/postProcessing/functionObjects/IO/removeRegisteredObject/removeRegisteredObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -92,7 +92,7 @@ void Foam::removeRegisteredObject::execute() void Foam::removeRegisteredObject::end() { - // Do nothing - only valid on execute + execute(); } diff --git a/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.C b/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.C index fff2c68041493d7637ba242a114b35ba13db656c..74fa1f0b008d1de6b82dc8e634e8de7f9e13b023 100644 --- a/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.C +++ b/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -195,7 +195,7 @@ void Foam::writeDictionary::execute() void Foam::writeDictionary::end() { - // do nothing + execute(); } diff --git a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C index 2c69ec63367f980e8693d82fdb97f90936e50be0..251b9d3f1f123a30e26d4be3601574786123aaeb 100644 --- a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C +++ b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C @@ -317,7 +317,6 @@ void Foam::fieldAverage::execute() if (active_) { calcAverages(); - Info<< endl; } } @@ -328,7 +327,6 @@ void Foam::fieldAverage::end() if (active_) { calcAverages(); - Info<< endl; } } diff --git a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C index 7fdb74f8128b06624f479a920484b8930d69ec4b..4e30b881ca63036130f5c1c53171220aef266c66 100644 --- a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C +++ b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -115,7 +115,10 @@ void Foam::fieldCoordinateSystemTransform::execute() void Foam::fieldCoordinateSystemTransform::end() { - // Do nothing + if (active_) + { + execute(); + } } diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C index 0c61259012ddffbf8dddd9077347ba9e9b31b405..d13ae8d791b6935798068ec1ffe511e9b5714940 100644 --- a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C +++ b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -159,10 +159,7 @@ void Foam::fieldMinMax::write() { functionObjectFile::write(); - if (log_) - { - Info<< type() << " " << name_ << " output:" << nl; - } + Info(log_)<< type() << " " << name_ << " output:" << nl; forAll(fieldSet_, fieldI) { @@ -173,10 +170,7 @@ void Foam::fieldMinMax::write() calcMinMaxFields<tensor>(fieldSet_[fieldI], mode_); } - if (log_) - { - Info<< endl; - } + Info(log_)<< endl; } } diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H index 25ccd00f4186ee3e9c54fada27c5453590f8afdf..361420da07307621676a022498d4b62c5b39a635 100644 --- a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H +++ b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -139,6 +139,20 @@ protected: // Private Member Functions + //- Helper function to write the output + template<class Type> + void output + ( + const word& fieldName, + const word& outputName, + const vector& minC, + const vector& maxC, + const label minProcI, + const label maxProcI, + const Type& minValue, + const Type& maxValue + ); + //- Disallow default bitwise copy construct fieldMinMax(const fieldMinMax&); diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxTemplates.C b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxTemplates.C index 4aa2a2b6cd9f44c4865e97eb954507ddb800dec8..a8477d8d50d18a1afe115fd90c1bf42aaa74c8a6 100644 --- a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,6 +31,62 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +template<class Type> +void Foam::fieldMinMax::output +( + const word& fieldName, + const word& outputName, + const vector& minC, + const vector& maxC, + const label minProcI, + const label maxProcI, + const Type& minValue, + const Type& maxValue +) +{ + file()<< obr_.time().value(); + writeTabbed(file(), fieldName); + + file() + << token::TAB << minValue + << token::TAB << minC; + + if (Pstream::parRun()) + { + file()<< token::TAB << minProcI; + } + + file() + << token::TAB << maxValue + << token::TAB << maxC; + + if (Pstream::parRun()) + { + file()<< token::TAB << maxProcI; + } + + file() << endl; + + Info(log_)<< " min(" << outputName << ") = " + << minValue << " at position " << minC; + + if (Pstream::parRun()) + { + Info(log_)<< " on processor " << minProcI; + } + + Info(log_)<< nl << " max(" << outputName << ") = " + << maxValue << " at position " << maxC; + + if (Pstream::parRun()) + { + Info(log_)<< " on processor " << maxProcI; + } + + Info(log_)<< endl; +} + + template<class Type> void Foam::fieldMinMax::calcMinMaxFields ( @@ -111,49 +167,17 @@ void Foam::fieldMinMax::calcMinMaxFields scalar maxValue = maxVs[maxI]; const vector& maxC = maxCs[maxI]; - file()<< obr_.time().value(); - writeTabbed(file(), fieldName); - - file() - << token::TAB << minValue - << token::TAB << minC; - - if (Pstream::parRun()) - { - file()<< token::TAB << minI; - } - - file() - << token::TAB << maxValue - << token::TAB << maxC; - - if (Pstream::parRun()) - { - file()<< token::TAB << maxI; - } - - file() << endl; - - if (log_) - { - Info<< " min(mag(" << fieldName << ")) = " - << minValue << " at position " << minC; - - if (Pstream::parRun()) - { - Info<< " on processor " << minI; - } - - Info<< nl << " max(mag(" << fieldName << ")) = " - << maxValue << " at position " << maxC; - - if (Pstream::parRun()) - { - Info<< " on processor " << maxI; - } - - Info<< endl; - } + output + ( + fieldName, + word("mag(" + fieldName + ")"), + minC, + maxC, + minI, + maxI, + minValue, + maxValue + ); } break; } @@ -216,49 +240,17 @@ void Foam::fieldMinMax::calcMinMaxFields Type maxValue = maxVs[maxI]; const vector& maxC = maxCs[maxI]; - file()<< obr_.time().value(); - writeTabbed(file(), fieldName); - - file() - << token::TAB << minValue - << token::TAB << minC; - - if (Pstream::parRun()) - { - file()<< token::TAB << minI; - } - - file() - << token::TAB << maxValue - << token::TAB << maxC; - - if (Pstream::parRun()) - { - file()<< token::TAB << maxI; - } - - file() << endl; - - if (log_) - { - Info<< " min(" << fieldName << ") = " - << minValue << " at position " << minC; - - if (Pstream::parRun()) - { - Info<< " on processor " << minI; - } - - Info<< nl << " max(" << fieldName << ") = " - << maxValue << " at position " << maxC; - - if (Pstream::parRun()) - { - Info<< " on processor " << maxI; - } - - Info<< endl; - } + output + ( + fieldName, + fieldName, + minC, + maxC, + minI, + maxI, + minValue, + maxValue + ); } break; } diff --git a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C index 595c16084d6f4af93065a9766be4bfdc2e685507..a441189f39cdc15a80927880b26d54209c00d289 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -245,10 +245,7 @@ void Foam::fieldValues::cellSource::write() file()<< endl; } - if (log_) - { - Info<< endl; - } + Info(log_)<< endl; } } diff --git a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceTemplates.C b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceTemplates.C index bdeccc6dd0ad79a485e6baf4a3d3cb3f0dd1ce13..372bd224b90ce9c6a25769dd7386750013e682d1 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -200,12 +200,9 @@ bool Foam::fieldValues::cellSource::writeValues(const word& fieldName) file()<< tab << result; - if (log_) - { - Info<< " " << operationTypeNames_[operation_] - << "(" << sourceName_ << ") for " << fieldName - << " = " << result << endl; - } + Info(log_)<< " " << operationTypeNames_[operation_] + << "(" << sourceName_ << ") for " << fieldName + << " = " << result << endl; } } diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C index 054ef4042350c0898a4413298d071a9429aa178c..ea38597aef6f35a7993cd8baec127b8467d63bac 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -663,10 +663,7 @@ void Foam::fieldValues::faceSource::write() file()<< endl; } - if (log_) - { - Info<< endl; - } + Info(log_)<< endl; } } diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C index 76b50be88f1f2db7fb6394c99ec4438b76562820..6def30c520f992ec55aae58fbbcf8b7db2718b84 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -344,12 +344,9 @@ bool Foam::fieldValues::faceSource::writeValues(const word& fieldName) file()<< tab << result; - if (log_) - { - Info<< " " << operationTypeNames_[operation_] - << "(" << sourceName_ << ") for " << fieldName - << " = " << result << endl; - } + Info(log_)<< " " << operationTypeNames_[operation_] + << "(" << sourceName_ << ") for " << fieldName + << " = " << result << endl; } } diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.C b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.C index 6d0856a9162d9d36a91ff55b275bccc3944d2a18..25f2c84cbec79cf8606e20a2aa94e829f2a54f35 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.C +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -58,10 +58,7 @@ void Foam::fieldValue::write() { functionObjectFile::write(); - if (log_) - { - Info<< type() << " " << name_ << " output:" << nl; - } + Info(log_)<< type() << " " << name_ << " output:" << nl; } } diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C index b251a362ea8b94673685a16349e9b7268a8e4ed9..d467b8146c3fc586ea4125d0129abde4b24a8dcc 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -158,10 +158,7 @@ void Foam::fieldValues::fieldValueDelta::write() file()<< obr_.time().value(); } - if (log_) - { - Info<< type() << " " << name_ << " output:" << endl; - } + Info(log_)<< type() << " " << name_ << " output:" << endl; bool found = false; processFields<scalar>(found); diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDeltaTemplates.C b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDeltaTemplates.C index b107c7952701dde83b5ae770b6e2eea8e4d8826c..48581422a9430e23e0bb6be7b7bb1731f85d36ca 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDeltaTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDeltaTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -114,12 +114,9 @@ void Foam::fieldValues::fieldValueDelta::processFields(bool& found) Type result = applyOperation(r1, r2); - if (log_) - { - Info<< " " << operationTypeNames_[operation_] - << "(" << fieldName << ") = " << result - << endl; - } + Info(log_)<< " " << operationTypeNames_[operation_] + << "(" << fieldName << ") = " << result + << endl; if (Pstream::master()) { diff --git a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C index 40211ae7a2b236c08e2780ecafb919535e3b5156..d65c9acf8779d104a68af599bd004e1949302cc0 100644 --- a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C +++ b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -374,6 +374,11 @@ void Foam::nearWallFields::end() { Info<< "nearWallFields:end()" << endl; } + + if (active_) + { + execute(); + } } diff --git a/src/postProcessing/functionObjects/field/processorField/processorField.C b/src/postProcessing/functionObjects/field/processorField/processorField.C index 37c61b5db2c5d5f75f00de0680df41c5af43b890..a57ee9a293026fa8c7ed30f13ebc12e716911192 100644 --- a/src/postProcessing/functionObjects/field/processorField/processorField.C +++ b/src/postProcessing/functionObjects/field/processorField/processorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -122,7 +122,10 @@ void Foam::processorField::execute() void Foam::processorField::end() { - // Do nothing + if (active_) + { + execute(); + } } diff --git a/src/postProcessing/functionObjects/field/readFields/readFields.C b/src/postProcessing/functionObjects/field/readFields/readFields.C index 7897bfd92b1661d68cdcc04048bb1e8667be8130..869f46beb013da8a1b89a0b2f4e638e516fd97a6 100644 --- a/src/postProcessing/functionObjects/field/readFields/readFields.C +++ b/src/postProcessing/functionObjects/field/readFields/readFields.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -91,36 +91,42 @@ void Foam::readFields::read(const dictionary& dict) void Foam::readFields::execute() { - //Info<< type() << " " << name_ << ":" << nl; - - // Clear out any previously loaded fields - vsf_.clear(); - vvf_.clear(); - vSpheretf_.clear(); - vSymmtf_.clear(); - vtf_.clear(); - - ssf_.clear(); - svf_.clear(); - sSpheretf_.clear(); - sSymmtf_.clear(); - stf_.clear(); - - forAll(fieldSet_, fieldI) + if (active_) { - // If necessary load field - loadField<scalar>(fieldSet_[fieldI], vsf_, ssf_); - loadField<vector>(fieldSet_[fieldI], vvf_, svf_); - loadField<sphericalTensor>(fieldSet_[fieldI], vSpheretf_, sSpheretf_); - loadField<symmTensor>(fieldSet_[fieldI], vSymmtf_, sSymmtf_); - loadField<tensor>(fieldSet_[fieldI], vtf_, stf_); + // Clear out any previously loaded fields + vsf_.clear(); + vvf_.clear(); + vSpheretf_.clear(); + vSymmtf_.clear(); + vtf_.clear(); + + ssf_.clear(); + svf_.clear(); + sSpheretf_.clear(); + sSymmtf_.clear(); + stf_.clear(); + + forAll(fieldSet_, fieldI) + { + const word& fieldName = fieldSet_[fieldI]; + + // If necessary load field + loadField<scalar>(fieldName, vsf_, ssf_); + loadField<vector>(fieldName, vvf_, svf_); + loadField<sphericalTensor>(fieldName, vSpheretf_, sSpheretf_); + loadField<symmTensor>(fieldName, vSymmtf_, sSymmtf_); + loadField<tensor>(fieldName, vtf_, stf_); + } } } void Foam::readFields::end() { - execute(); + if (active_) + { + execute(); + } } diff --git a/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.C b/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.C index 53e991d76bd16aac43cb7bfc1b741e481fe4c17a..0048f0d15abef09ff1bbcd30ceb2ddbe65698a0d 100644 --- a/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.C +++ b/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -114,7 +114,10 @@ void Foam::surfaceInterpolateFields::execute() void Foam::surfaceInterpolateFields::end() { - // Do nothing + if (active_) + { + execute(); + } } diff --git a/src/postProcessing/functionObjects/field/turbulenceFields/turbulenceFields.C b/src/postProcessing/functionObjects/field/turbulenceFields/turbulenceFields.C index b3fd284abd46539ff126fd984b82794c3cf3d16a..9f25e517a7930ee2ef7c2c2cba5c77fbfe019fa4 100644 --- a/src/postProcessing/functionObjects/field/turbulenceFields/turbulenceFields.C +++ b/src/postProcessing/functionObjects/field/turbulenceFields/turbulenceFields.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -257,7 +257,10 @@ void Foam::turbulenceFields::execute() void Foam::turbulenceFields::end() { - // Do nothing + if (active_) + { + execute(); + } } diff --git a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C index 42ae77e264aa392b38e1b8c04659aa7e1db66c67..283a93e426c0d0d28e497b7bf6d0939b3939864b 100644 --- a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C +++ b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -227,15 +227,12 @@ void Foam::forceCoeffs::write() << obr_.time().value() << tab << Cm << tab << Cd << tab << Cl << tab << Clf << tab << Clr << endl; - if (log_) - { - Info<< type() << " " << name_ << " output:" << nl - << " Cm = " << Cm << nl - << " Cd = " << Cd << nl - << " Cl = " << Cl << nl - << " Cl(f) = " << Clf << nl - << " Cl(r) = " << Clr << endl; - } + Info(log_)<< type() << " " << name_ << " output:" << nl + << " Cm = " << Cm << nl + << " Cd = " << Cd << nl + << " Cl = " << Cl << nl + << " Cl(f) = " << Clf << nl + << " Cl(r) = " << Clr << endl; if (nBin_ > 1) { @@ -262,10 +259,7 @@ void Foam::forceCoeffs::write() file(1) << endl; } - if (log_) - { - Info<< endl; - } + Info(log_)<< endl; } } diff --git a/src/postProcessing/functionObjects/forces/forces/forces.C b/src/postProcessing/functionObjects/forces/forces/forces.C index c096ad5d4b0ac3832db70a4b0aa1cec15f4bb43f..e38c5a462240669fcbf362d54bf8e15127d66e56 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.C +++ b/src/postProcessing/functionObjects/forces/forces/forces.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -391,19 +391,17 @@ void Foam::forces::applyBins void Foam::forces::writeForces() { - if (log_) - { - Info<< type() << " " << name_ << " output:" << nl - << " sum of forces:" << nl - << " pressure : " << sum(force_[0]) << nl - << " viscous : " << sum(force_[1]) << nl - << " porous : " << sum(force_[2]) << nl - << " sum of moments:" << nl - << " pressure : " << sum(moment_[0]) << nl - << " viscous : " << sum(moment_[1]) << nl - << " porous : " << sum(moment_[2]) - << endl; - } + Info(log_) + << type() << " " << name_ << " output:" << nl + << " sum of forces:" << nl + << " pressure : " << sum(force_[0]) << nl + << " viscous : " << sum(force_[1]) << nl + << " porous : " << sum(force_[2]) << nl + << " sum of moments:" << nl + << " pressure : " << sum(moment_[0]) << nl + << " viscous : " << sum(moment_[1]) << nl + << " porous : " << sum(moment_[2]) + << endl; file(0) << obr_.time().value() << tab << setw(1) << '[' << sum(force_[0]) << setw(1) << ',' @@ -642,10 +640,7 @@ void Foam::forces::read(const dictionary& dict) log_ = dict.lookupOrDefault<Switch>("log", false); - if (log_) - { - Info<< type() << " " << name_ << ":" << nl; - } + Info(log_)<< type() << " " << name_ << ":" << nl; directForceDensity_ = dict.lookupOrDefault("directForceDensity", false); @@ -809,10 +804,7 @@ void Foam::forces::write() writeBins(); - if (log_) - { - Info<< endl; - } + Info(log_)<< endl; } } diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.C b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.C index 9620fe3222adcf0f6a0b6f7d85dbd2ffdb6f0dac..8c951de8ecfe0a73440c5e48d4b7d2c7251d7bab 100644 --- a/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.C +++ b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -154,7 +154,10 @@ void Foam::calcFvcDiv::execute() void Foam::calcFvcDiv::end() { - // Do nothing + if (active_) + { + execute(); + } } diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.C b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.C index 31d24da4e9c0130c28da6b2c59495d6c0b72ec4f..c0642ecf01baeb6edce31cf09e2ca6cdd1a228ef 100644 --- a/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.C +++ b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -116,7 +116,10 @@ void Foam::calcFvcGrad::execute() void Foam::calcFvcGrad::end() { - // Do nothing + if (active_) + { + execute(); + } } diff --git a/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.C b/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.C index 3b400f4889d47ca279118f1fe81ba5d464634af0..d853aaf00dca833f0b4d60ff51c43daf7c0abde5 100644 --- a/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.C +++ b/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -119,7 +119,10 @@ void Foam::calcMag::execute() void Foam::calcMag::end() { - // Do nothing + if (active_) + { + execute(); + } } diff --git a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C index 2a662c6513660c96d71ba68d334baa94df5eb4d5..dbb81f83639bba5be5a157c06dab7fea09efecd1 100644 --- a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C +++ b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -185,7 +185,10 @@ void Foam::CourantNo::execute() void Foam::CourantNo::end() { - // Do nothing + if (active_) + { + execute(); + } } diff --git a/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.C b/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.C index 0edfdb727d66dbb7251da0446c98215fa4d7478a..0bfbc94126b7976d4e45e37ecf36c12240add3a7 100644 --- a/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.C +++ b/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -142,10 +142,7 @@ void Foam::DESModelRegions::execute() const fvMesh& mesh = refCast<const fvMesh>(obr_); - if (log_) - { - Info<< type() << " " << name_ << " output:" << nl; - } + Info(log_)<< type() << " " << name_ << " output:" << nl; volScalarField& DESModelRegions = const_cast<volScalarField&> @@ -196,19 +193,14 @@ void Foam::DESModelRegions::execute() << endl; } - if (log_) - { - Info<< " LES = " << prc << " % (volume)" << nl - << " RAS = " << 100.0 - prc << " % (volume)" << endl; - } + Info(log_) + << " LES = " << prc << " % (volume)" << nl + << " RAS = " << 100.0 - prc << " % (volume)" << endl; } else { - if (log_) - { - Info<< " No DES turbulence model found in database" << nl - << endl; - } + Info(log_)<< " No DES turbulence model found in database" << nl + << endl; } } } @@ -216,7 +208,10 @@ void Foam::DESModelRegions::execute() void Foam::DESModelRegions::end() { - // Do nothing + if (active_) + { + execute(); + } } diff --git a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C index b008b7b4fa54123e6134bcedf4157e5aecf2a57b..3c72fbfd9b57032b983996b0e1d24e6cc7f2ccb2 100644 --- a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C +++ b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -144,7 +144,10 @@ void Foam::Lambda2::execute() void Foam::Lambda2::end() { - // Do nothing + if (active_) + { + execute(); + } } diff --git a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C index 0c77608b13ffb1877685e1884749adfa6b739c0b..6d288fcfc00bff8e1591ecca5ec976d9c08a8fda 100644 --- a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C +++ b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -197,7 +197,10 @@ void Foam::Peclet::execute() void Foam::Peclet::end() { - // Do nothing + if (active_) + { + execute(); + } } void Foam::Peclet::timeSet() diff --git a/src/postProcessing/functionObjects/utilities/Q/Q.C b/src/postProcessing/functionObjects/utilities/Q/Q.C index a17561217e6373722d8c10c000e186b2497fba19..2dda80a88ba632a103161752fc09834aaf511aa6 100644 --- a/src/postProcessing/functionObjects/utilities/Q/Q.C +++ b/src/postProcessing/functionObjects/utilities/Q/Q.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -137,7 +137,10 @@ void Foam::Q::execute() void Foam::Q::end() { - // Do nothing + if (active_) + { + execute(); + } } diff --git a/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.C b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.C index 351c48bfb4b6f4994753dcc7221b1764fed87199..3c98c9d86f237b13d41dadf32d9a37ed8d2d9ef6 100644 --- a/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.C +++ b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -101,7 +101,10 @@ void Foam::blendingFactor::execute() void Foam::blendingFactor::end() { - // Do nothing + if (active_) + { + execute(); + } } void Foam::blendingFactor::timeSet() diff --git a/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C b/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C index 3417dfec39071f035a722b7fd8c11eddddb4b0b0..2d6c157d4dfa6c4da65d2405843e68bd126e0155 100644 --- a/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C +++ b/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -309,7 +309,10 @@ void Foam::pressureTools::execute() void Foam::pressureTools::end() { - // Do nothing + if (active_) + { + execute(); + } } diff --git a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C index b63fe4acd8b1cc5095cae4a4b602404722b82e79..4428388604b3258d552d40923c141253c15ed524 100644 --- a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C +++ b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -214,92 +214,97 @@ void Foam::scalarTransport::read(const dictionary& dict) void Foam::scalarTransport::execute() { - Info<< type() << " output:" << endl; - - const surfaceScalarField& phi = - mesh_.lookupObject<surfaceScalarField>(phiName_); + if (active_) + { + Info<< type() << " output:" << endl; - // calculate the diffusivity - volScalarField DT(this->DT(phi)); + const surfaceScalarField& phi = + mesh_.lookupObject<surfaceScalarField>(phiName_); - // set schemes - word schemeVar = T_.name(); - if (autoSchemes_) - { - schemeVar = UName_; - } + // calculate the diffusivity + volScalarField DT(this->DT(phi)); - word divScheme("div(phi," + schemeVar + ")"); - word laplacianScheme("laplacian(" + DT.name() + "," + schemeVar + ")"); + // set schemes + word schemeVar = T_.name(); + if (autoSchemes_) + { + schemeVar = UName_; + } - // set under-relaxation coeff - scalar relaxCoeff = 0.0; - if (mesh_.relaxEquation(schemeVar)) - { - relaxCoeff = mesh_.equationRelaxationFactor(schemeVar); - } + word divScheme("div(phi," + schemeVar + ")"); + word laplacianScheme("laplacian(" + DT.name() + "," + schemeVar + ")"); - if (phi.dimensions() == dimMass/dimTime) - { - const volScalarField& rho = - mesh_.lookupObject<volScalarField>(rhoName_); + // set under-relaxation coeff + scalar relaxCoeff = 0.0; + if (mesh_.relaxEquation(schemeVar)) + { + relaxCoeff = mesh_.equationRelaxationFactor(schemeVar); + } - // solve - for (label i = 0; i <= nCorr_; i++) + if (phi.dimensions() == dimMass/dimTime) { - fvScalarMatrix TEqn - ( - fvm::ddt(rho, T_) - + fvm::div(phi, T_, divScheme) - - fvm::laplacian(DT, T_, laplacianScheme) - == - fvOptions_(rho, T_) - ); + const volScalarField& rho = + mesh_.lookupObject<volScalarField>(rhoName_); + + // solve + for (label i = 0; i <= nCorr_; i++) + { + fvScalarMatrix TEqn + ( + fvm::ddt(rho, T_) + + fvm::div(phi, T_, divScheme) + - fvm::laplacian(DT, T_, laplacianScheme) + == + fvOptions_(rho, T_) + ); - TEqn.relax(relaxCoeff); + TEqn.relax(relaxCoeff); - fvOptions_.constrain(TEqn); + fvOptions_.constrain(TEqn); - TEqn.solve(mesh_.solverDict(schemeVar)); + TEqn.solve(mesh_.solverDict(schemeVar)); + } } - } - else if (phi.dimensions() == dimVolume/dimTime) - { - // solve - for (label i = 0; i <= nCorr_; i++) + else if (phi.dimensions() == dimVolume/dimTime) { - fvScalarMatrix TEqn - ( - fvm::ddt(T_) - + fvm::div(phi, T_, divScheme) - - fvm::laplacian(DT, T_, laplacianScheme) - == - fvOptions_(T_) - ); + // solve + for (label i = 0; i <= nCorr_; i++) + { + fvScalarMatrix TEqn + ( + fvm::ddt(T_) + + fvm::div(phi, T_, divScheme) + - fvm::laplacian(DT, T_, laplacianScheme) + == + fvOptions_(T_) + ); - TEqn.relax(relaxCoeff); + TEqn.relax(relaxCoeff); - fvOptions_.constrain(TEqn); + fvOptions_.constrain(TEqn); - TEqn.solve(mesh_.solverDict(schemeVar)); + TEqn.solve(mesh_.solverDict(schemeVar)); + } + } + else + { + FatalErrorIn("void Foam::scalarTransport::execute()") + << "Incompatible dimensions for phi: " << phi.dimensions() << nl + << "Dimensions should be " << dimMass/dimTime << " or " + << dimVolume/dimTime << endl; } - } - else - { - FatalErrorIn("void Foam::scalarTransport::execute()") - << "Incompatible dimensions for phi: " << phi.dimensions() << nl - << "Dimensions should be " << dimMass/dimTime << " or " - << dimVolume/dimTime << endl; - } - - Info<< endl; + Info<< endl; + } } void Foam::scalarTransport::end() { - // Do nothing + if (active_) + { + execute(); + } } diff --git a/src/postProcessing/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C b/src/postProcessing/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C index 9329ad6e3f554a25fd44cf510ac4d247f595e7cc..91d5f381f601279637dd2025d04dfc28c17921ef 100644 --- a/src/postProcessing/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C +++ b/src/postProcessing/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -132,7 +132,10 @@ void Foam::timeActivatedFileUpdate::execute() void Foam::timeActivatedFileUpdate::end() { - // Do nothing + if (active_) + { + execute(); + } } diff --git a/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C index a507428c6f442846845deabe6504b646b8725795..64255a7efd979a0db0261fda6ccafd920503d7c0 100644 --- a/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C +++ b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -82,11 +82,8 @@ void Foam::wallShearStress::calcShearStress << endl; } - if (log_) - { - Info<< " min/max(" << pp.name() << ") = " - << minSsp << ", " << maxSsp << endl; - } + Info(log_)<< " min/max(" << pp.name() << ") = " + << minSsp << ", " << maxSsp << endl; } } @@ -240,10 +237,7 @@ void Foam::wallShearStress::execute() mesh.lookupObject<volVectorField>(type()) ); - if (log_) - { - Info<< type() << " " << name_ << " output:" << nl; - } + Info(log_)<< type() << " " << name_ << " output:" << nl; tmp<volSymmTensorField> Reff; @@ -275,7 +269,10 @@ void Foam::wallShearStress::execute() void Foam::wallShearStress::end() { - // Do nothing + if (active_) + { + execute(); + } } @@ -294,12 +291,9 @@ void Foam::wallShearStress::write() const volVectorField& wallShearStress = obr_.lookupObject<volVectorField>(type()); - if (log_) - { - Info<< type() << " " << name_ << " output:" << nl - << " writing field " << wallShearStress.name() << nl - << endl; - } + Info(log_)<< type() << " " << name_ << " output:" << nl + << " writing field " << wallShearStress.name() << nl + << endl; wallShearStress.write(); } diff --git a/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C b/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C index 57951c6bae940e1a334f5277a9498878236afaed..b84942fffb0b68a242bfd6cfa12048bd2e099268 100644 --- a/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C +++ b/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -94,15 +94,12 @@ void Foam::yPlusLES::calcIncompressibleYPlus scalar maxYp = gMax(Yp); scalar avgYp = gAverage(Yp); - if (log_) + if (Pstream::master()) { - Info<< " patch " << currPatch.name() + Info(log_)<< " patch " << currPatch.name() << " y+ : min = " << minYp << ", max = " << maxYp << ", average = " << avgYp << nl; - } - if (Pstream::master()) - { file() << obr_.time().value() << token::TAB << currPatch.name() << token::TAB << minYp @@ -162,15 +159,12 @@ void Foam::yPlusLES::calcCompressibleYPlus scalar maxYp = gMax(Yp); scalar avgYp = gAverage(Yp); - if (log_) + if (Pstream::master()) { - Info<< " patch " << currPatch.name() + Info(log_)<< " patch " << currPatch.name() << " y+ : min = " << minYp << ", max = " << maxYp << ", average = " << avgYp << nl; - } - if (Pstream::master()) - { file() << obr_.time().value() << token::TAB << currPatch.name() << token::TAB << minYp @@ -286,10 +280,7 @@ void Foam::yPlusLES::execute() mesh.lookupObject<volScalarField>(type()) ); - if (log_) - { - Info<< type() << " " << name_ << " output:" << nl; - } + Info(log_)<< type() << " " << name_ << " output:" << nl; if (phi.dimensions() == dimMass/dimTime) { @@ -305,7 +296,10 @@ void Foam::yPlusLES::execute() void Foam::yPlusLES::end() { - // Do nothing + if (active_) + { + execute(); + } } @@ -324,10 +318,7 @@ void Foam::yPlusLES::write() const volScalarField& yPlusLES = obr_.lookupObject<volScalarField>(type()); - if (log_) - { - Info<< " writing field " << yPlusLES.name() << nl << endl; - } + Info(log_)<< " writing field " << yPlusLES.name() << nl << endl; yPlusLES.write(); } diff --git a/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C b/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C index 8d84bda486075be307ae8b01dde2f991fa9cf58d..c93875b3e5ffaf05d516bcb3877109daf0d075eb 100644 --- a/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C +++ b/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -89,15 +89,12 @@ void Foam::yPlusRAS::calcIncompressibleYPlus scalar maxYp = gMax(Yp); scalar avgYp = gAverage(Yp); - if (log_) + if (Pstream::master()) { - Info<< " patch " << nutPw.patch().name() + Info(log_)<< " patch " << nutPw.patch().name() << " y+ : min = " << minYp << ", max = " << maxYp << ", average = " << avgYp << nl; - } - if (Pstream::master()) - { file() << obr_.time().value() << token::TAB << nutPw.patch().name() << token::TAB << minYp @@ -149,15 +146,12 @@ void Foam::yPlusRAS::calcCompressibleYPlus scalar maxYp = gMax(Yp); scalar avgYp = gAverage(Yp); - if (log_) + if (Pstream::master()) { - Info<< " patch " << mutPw.patch().name() + Info(log_)<< " patch " << mutPw.patch().name() << " y+ : min = " << minYp << ", max = " << maxYp << ", average = " << avgYp << nl; - } - if (Pstream::master()) - { file() << obr_.time().value() << token::TAB << mutPw.patch().name() << token::TAB << minYp @@ -271,10 +265,7 @@ void Foam::yPlusRAS::execute() mesh.lookupObject<volScalarField>(type()) ); - if (log_) - { - Info<< type() << " " << name_ << " output:" << nl; - } + Info(log_)<< type() << " " << name_ << " output:" << nl; if (phi.dimensions() == dimMass/dimTime) { @@ -290,7 +281,10 @@ void Foam::yPlusRAS::execute() void Foam::yPlusRAS::end() { - // Do nothing + if (active_) + { + execute(); + } } @@ -309,10 +303,7 @@ void Foam::yPlusRAS::write() const volScalarField& yPlusRAS = obr_.lookupObject<volScalarField>(type()); - if (log_) - { - Info<< " writing field " << yPlusRAS.name() << nl << endl; - } + Info(log_)<< " writing field " << yPlusRAS.name() << nl << endl; yPlusRAS.write(); }