diff --git a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C index 8acbe5cc0..fef631eae 100644 --- a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C +++ b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C @@ -60,7 +60,8 @@ fieldCoordinateSystemTransform { read(dict); - Info<< type() << " " << name << ":" << nl + if (log_) Info + << type() << " " << name << ":" << nl << " Applying transformation from global Cartesian to local " << coordSys_ << nl << endl; } diff --git a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H index 633292f65..2ac288843 100644 --- a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H +++ b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H @@ -82,10 +82,6 @@ SourceFiles namespace Foam { - -// Forward declaration of classes -class objectRegistry; - namespace functionObjects { diff --git a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransformTemplates.C b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransformTemplates.C index 72c01ddc2..c03c49cae 100644 --- a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransformTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransformTemplates.C @@ -57,11 +57,9 @@ void Foam::functionObjects::fieldCoordinateSystemTransform::transform if (mesh_.foundObject(fieldName)) { - if (debug) - { - Info<< type() << ": Field " << fieldName << " already in database" - << endl; - } + DebugInfo + << type() << ": Field " << fieldName << " already in database" + << endl; transformField ( @@ -70,11 +68,9 @@ void Foam::functionObjects::fieldCoordinateSystemTransform::transform } else if (mesh_.foundObject(fieldName)) { - if (debug) - { - Info<< type() << ": Field " << fieldName << " already in database" - << endl; - } + DebugInfo + << type() << ": Field " << fieldName << " already in database" + << endl; transformField ( @@ -98,11 +94,9 @@ void Foam::functionObjects::fieldCoordinateSystemTransform::transform && fieldHeader.headerClassName() == VolFieldType::typeName ) { - if (debug) - { - Info<< type() << ": Field " << fieldName << " read from file" - << endl; - } + DebugInfo + << type() << ": Field " << fieldName << " read from file" + << endl; transformField ( @@ -115,11 +109,9 @@ void Foam::functionObjects::fieldCoordinateSystemTransform::transform && fieldHeader.headerClassName() == SurfaceFieldType::typeName ) { - if (debug) - { - Info<< type() << ": Field " << fieldName << " read from file" - << endl; - } + DebugInfo + << type() << ": Field " << fieldName << " read from file" + << endl; transformField ( diff --git a/src/postProcessing/functionObjects/field/histogram/histogram.C b/src/postProcessing/functionObjects/field/histogram/histogram.C index c8ea8b7f3..d0e4d812b 100644 --- a/src/postProcessing/functionObjects/field/histogram/histogram.C +++ b/src/postProcessing/functionObjects/field/histogram/histogram.C @@ -57,7 +57,8 @@ void Foam::functionObjects::histogram::writeGraph outputPath/formatterPtr_().getFileName(coords, fieldNames) ); - Info<< " Writing histogram of " << fieldName + if (log_) Info + << " Writing histogram of " << fieldName << " to " << graphFile.name() << endl; List yPtrs(1); @@ -117,18 +118,18 @@ bool Foam::functionObjects::histogram::execute(const bool postProcess) bool Foam::functionObjects::histogram::write(const bool postProcess) { - Info<< type() << " " << name() << " output:" << nl; + if (log_) Info<< type() << " " << name() << " output:" << nl; const fvMesh& mesh = refCast(obr_); autoPtr fieldPtr; if (obr_.foundObject(fieldName_)) { - Info<< " Looking up field " << fieldName_ << endl; + if (log_) Info<< " Looking up field " << fieldName_ << endl; } else { - Info<< " Reading field " << fieldName_ << endl; + if (log_) Info<< " Reading field " << fieldName_ << endl; fieldPtr.reset ( new volScalarField diff --git a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C index eed5d6786..8360147cf 100644 --- a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C +++ b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C @@ -57,10 +57,7 @@ void Foam::functionObjects::nearWallFields::calcAddressing() // Global indexing globalIndex globalWalls(nPatchFaces); - if (debug) - { - InfoInFunction << "nPatchFaces: " << globalWalls.size() << endl; - } + DebugInFunction << "nPatchFaces: " << globalWalls.size() << endl; // Construct cloud Cloud cloud(mesh_, IDLList()); @@ -239,10 +236,7 @@ Foam::functionObjects::nearWallFields::nearWallFields Foam::functionObjects::nearWallFields::~nearWallFields() { - if (debug) - { - InfoInFunction << endl; - } + DebugInFunction << endl; } @@ -282,8 +276,8 @@ bool Foam::functionObjects::nearWallFields::read(const dictionary& dict) reverseFieldMap_.insert(sampleFldName, fldName); } - Info<< type() << " " << name() << ": Sampling " << fieldMap_.size() - << " fields" << endl; + if (log_) Info << type() << " " << name() + << ": Sampling " << fieldMap_.size() << " fields" << endl; // Do analysis calcAddressing(); @@ -294,10 +288,7 @@ bool Foam::functionObjects::nearWallFields::read(const dictionary& dict) bool Foam::functionObjects::nearWallFields::execute(const bool postProcess) { - if (debug) - { - InfoInFunction << endl; - } + DebugInFunction << endl; if ( @@ -309,8 +300,8 @@ bool Foam::functionObjects::nearWallFields::execute(const bool postProcess) && vtf_.empty() ) { - Info<< type() << " " << name() << ": Creating " << fieldMap_.size() - << " fields" << endl; + if (log_) Info<< type() << " " << name() + << ": Creating " << fieldMap_.size() << " fields" << endl; createFields(vsf_); createFields(vvf_); @@ -318,12 +309,12 @@ bool Foam::functionObjects::nearWallFields::execute(const bool postProcess) createFields(vSymmtf_); createFields(vtf_); - Info<< endl; + if (log_) Info<< endl; } - Info<< type() << " " << name() << " output:" << nl; - - Info<< " Sampling fields to " << time_.timeName() + if (log_) Info<< type() << " " << name() + << " output:" << nl + << " Sampling fields to " << time_.timeName() << endl; sampleFields(vsf_); @@ -338,12 +329,9 @@ bool Foam::functionObjects::nearWallFields::execute(const bool postProcess) bool Foam::functionObjects::nearWallFields::write(const bool postProcess) { - if (debug) - { - InfoInFunction << endl; - } + DebugInFunction << endl; - Info<< " Writing sampled fields to " << time_.timeName() + if (log_) Info<< " Writing sampled fields to " << time_.timeName() << endl; forAll(vsf_, i) @@ -367,7 +355,7 @@ bool Foam::functionObjects::nearWallFields::write(const bool postProcess) vtf_[i].write(); } - Info<< endl; + if (log_) Info<< endl; return true; } diff --git a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFieldsTemplates.C b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFieldsTemplates.C index e740b8a9a..64dc5575f 100644 --- a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFieldsTemplates.C +++ b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFieldsTemplates.C @@ -47,7 +47,7 @@ void Foam::functionObjects::nearWallFields::createFields if (obr_.found(sampleFldName)) { - Info<< " a field " << sampleFldName + if (log_) Info<< " a field " << sampleFldName << " already exists on the mesh." << endl; } @@ -63,8 +63,8 @@ void Foam::functionObjects::nearWallFields::createFields sflds.set(sz, new VolFieldType(io, fld)); - Info<< " created " << sflds[sz].name() << " to sample " - << fld.name() << endl; + if (log_) Info<< " created " << sflds[sz].name() + << " to sample " << fld.name() << endl; } } } diff --git a/src/postProcessing/functionObjects/field/readFields/readFieldsTemplates.C b/src/postProcessing/functionObjects/field/readFields/readFieldsTemplates.C index 4f26c37bb..499f8676f 100644 --- a/src/postProcessing/functionObjects/field/readFields/readFieldsTemplates.C +++ b/src/postProcessing/functionObjects/field/readFields/readFieldsTemplates.C @@ -43,19 +43,15 @@ void Foam::functionObjects::readFields::loadField if (obr_.foundObject(fieldName)) { - if (debug) - { - Info<< "readFields : Field " << fieldName << " already in database" - << endl; - } + DebugInfo + << "readFields : Field " << fieldName << " already in database" + << endl; } else if (obr_.foundObject(fieldName)) { - if (debug) - { - Info<< "readFields : Field " << fieldName << " already in database" - << endl; - } + DebugInfo + << "readFields : Field " << fieldName + << " already in database" << endl; } else { @@ -74,8 +70,9 @@ void Foam::functionObjects::readFields::loadField && fieldHeader.headerClassName() == VolFieldType::typeName ) { - // store field locally - Info<< " Reading " << fieldName << endl; + // Store field locally + if (log_) Info<< " Reading " << fieldName << endl; + label sz = vflds.size(); vflds.setSize(sz+1); vflds.set(sz, new VolFieldType(fieldHeader, mesh_)); @@ -86,8 +83,9 @@ void Foam::functionObjects::readFields::loadField && fieldHeader.headerClassName() == SurfaceFieldType::typeName ) { - // store field locally - Info<< " Reading " << fieldName << endl; + // Store field locally + if (log_) Info<< " Reading " << fieldName << endl; + label sz = sflds.size(); sflds.setSize(sz+1); sflds.set(sz, new SurfaceFieldType(fieldHeader, mesh_)); diff --git a/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H b/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H index 65ccfab63..12e3bbfbf 100644 --- a/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H +++ b/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H @@ -119,7 +119,6 @@ namespace Foam { // Forward declaration of classes -class objectRegistry; class regionSplit; namespace functionObjects diff --git a/src/postProcessing/functionObjects/utilities/turbulenceFields/turbulenceFields.C b/src/postProcessing/functionObjects/utilities/turbulenceFields/turbulenceFields.C index 5992908a7..15671440e 100644 --- a/src/postProcessing/functionObjects/utilities/turbulenceFields/turbulenceFields.C +++ b/src/postProcessing/functionObjects/utilities/turbulenceFields/turbulenceFields.C @@ -127,22 +127,9 @@ Foam::functionObjects::turbulenceFields::turbulenceFields const dictionary& dict ) : - functionObject(name), - obr_ - ( - runTime.lookupObject - ( - dict.lookupOrDefault("region", polyMesh::defaultRegion) - ) - ), + fvMeshFunctionObject(name, runTime, dict), fieldSet_() { - if (!isA(obr_)) - { - FatalErrorInFunction - << "objectRegistry is not an fvMesh" << exit(FatalError); - } - if ( !obr_.foundObject(modelName) diff --git a/src/postProcessing/functionObjects/utilities/yPlus/yPlus.H b/src/postProcessing/functionObjects/utilities/yPlus/yPlus.H index b529b99b6..363cd8074 100644 --- a/src/postProcessing/functionObjects/utilities/yPlus/yPlus.H +++ b/src/postProcessing/functionObjects/utilities/yPlus/yPlus.H @@ -53,7 +53,6 @@ namespace Foam { // Forward declaration of classes -class objectRegistry; class fvMesh; class turbulenceModel;