From 98cc307aec2eb98d5cd279be8c4302f554f3294a Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 14 Aug 2013 11:10:27 +0100 Subject: [PATCH] ENH: Function objects - notify when writing results --- .../IO/removeRegisteredObject/removeRegisteredObject.C | 4 ++++ .../functionObjects/IO/writeDictionary/writeDictionary.C | 2 +- .../IO/writeRegisteredObject/writeRegisteredObject.C | 5 +++++ .../fvTools/calcFvcDiv/calcFvcDivTemplates.C | 6 +++--- .../fvTools/calcFvcGrad/calcFvcGradTemplates.C | 6 +++--- .../functionObjects/utilities/CourantNo/CourantNo.C | 7 ++++--- .../utilities/DESModelRegions/DESModelRegions.C | 3 ++- .../functionObjects/utilities/Lambda2/Lambda2.C | 7 ++++--- .../functionObjects/utilities/Peclet/Peclet.C | 7 ++++--- src/postProcessing/functionObjects/utilities/Q/Q.C | 7 ++++--- .../utilities/pressureTools/pressureTools.C | 4 ++++ .../utilities/wallShearStress/wallShearStress.C | 5 +++-- .../functionObjects/utilities/yPlusLES/yPlusLES.C | 5 +++-- .../functionObjects/utilities/yPlusRAS/yPlusRAS.C | 5 +++-- 14 files changed, 47 insertions(+), 26 deletions(-) diff --git a/src/postProcessing/functionObjects/IO/removeRegisteredObject/removeRegisteredObject.C b/src/postProcessing/functionObjects/IO/removeRegisteredObject/removeRegisteredObject.C index 4ed2bb524a..eb4f5ee21a 100644 --- a/src/postProcessing/functionObjects/IO/removeRegisteredObject/removeRegisteredObject.C +++ b/src/postProcessing/functionObjects/IO/removeRegisteredObject/removeRegisteredObject.C @@ -78,6 +78,10 @@ void Foam::removeRegisteredObject::execute() if (obj.ownedByRegistry()) { + Info<< type() << " " << name_ << " output:" << nl + << " removing object " << obj.name() << nl + << endl; + const_cast(obj).release(); delete &obj; } diff --git a/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.C b/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.C index 56cd35a407..8532c8a004 100644 --- a/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.C +++ b/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.C @@ -63,7 +63,7 @@ bool Foam::writeDictionary::tryFolder { if (firstDict) { - Info<< type() << " output:" << nl << endl; + Info<< type() << " " << name_ << " output:" << nl << endl; IOobject::writeDivider(Info); Info<< endl; diff --git a/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.C b/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.C index 3700727407..6b1733ce02 100644 --- a/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.C +++ b/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.C @@ -98,6 +98,11 @@ void Foam::writeRegisteredObject::write() ); // Switch off automatic writing to prevent double write obj.writeOpt() = IOobject::NO_WRITE; + + Info<< type() << " " << name_ << " output:" << nl + << " writing object " << obj.name() << nl + << endl; + obj.write(); } else diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDivTemplates.C b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDivTemplates.C index cfdf55f1bf..d7db1e4081 100644 --- a/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDivTemplates.C +++ b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDivTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -52,8 +52,8 @@ void Foam::calcFvcDiv::calcDiv field = fvc::div(vf); - Info<< type() << " output:" << nl - << " writing " << field.name() << " field" << nl << endl; + Info<< type() << " " << name_ << " output:" << nl + << " writing field " << field.name() << nl << endl; field.write(); diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGradTemplates.C b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGradTemplates.C index 3e95bbd424..d8180c1e30 100644 --- a/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGradTemplates.C +++ b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGradTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -120,8 +120,8 @@ void Foam::calcFvcGrad::calcGrad field = fvc::grad(sf); - Info<< type() << " output:" << nl - << " writing " << field.name() << " field" << nl << endl; + Info<< type() << " " << name_ << " output:" << nl + << " writing field " << field.name() << nl << endl; field.write(); diff --git a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C index 9309ba42bb..5e8a3d8e55 100644 --- a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C +++ b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C @@ -198,10 +198,11 @@ void Foam::CourantNo::write() CourantNo.correctBoundaryConditions(); - CourantNo.write(); + Info<< type() << " " << name_ << " output:" << nl + << " writing field " << CourantNo.name() << nl + << endl; - Info<< type() << " output:" << nl - << " writing " << CourantNo.name() << " field" << nl << endl; + CourantNo.write(); } } diff --git a/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.C b/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.C index 9f861596f7..9ba1319e22 100644 --- a/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.C +++ b/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.C @@ -136,7 +136,7 @@ void Foam::DESModelRegions::write() if (log_) { - Info<< type() << " output:" << nl; + Info<< type() << " " << name_ << " output:" << nl; } tmp tresult; @@ -186,6 +186,7 @@ void Foam::DESModelRegions::write() { Info<< " LES = " << prc << " % (volume)" << nl << " RAS = " << 100.0 - prc << " % (volume)" << nl + << " writing field " << result.name() << nl << endl; } diff --git a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C index 0f1dd72a92..53752737fe 100644 --- a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C +++ b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C @@ -157,10 +157,11 @@ void Foam::Lambda2::write() Lambda2 = -eigenValues(SSplusWW)().component(vector::Y); - Lambda2.write(); + Info<< type() << " " << name_ << " output:" << nl + << " writing field " << Lambda2.name() << nl + << endl; - Info<< type() << " output:" << nl - << " writing " << Lambda2.name() << " field" << nl << endl; + Lambda2.write(); } } diff --git a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C index 681e36fc9e..d577154d70 100644 --- a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C +++ b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C @@ -209,10 +209,11 @@ void Foam::Peclet::write() *fvc::interpolate(nuEff) ); - Peclet.write(); + Info<< type() << " " << name_ << " output:" << nl + << " writing field " << Peclet.name() << nl + << endl; - Info<< type() << " output:" << nl - << " writing " << Peclet.name() << " field" << nl << endl; + Peclet.write(); } } diff --git a/src/postProcessing/functionObjects/utilities/Q/Q.C b/src/postProcessing/functionObjects/utilities/Q/Q.C index 81a68a152a..fbb397a323 100644 --- a/src/postProcessing/functionObjects/utilities/Q/Q.C +++ b/src/postProcessing/functionObjects/utilities/Q/Q.C @@ -150,10 +150,11 @@ void Foam::Q::write() Q = 0.5*(sqr(tr(gradU)) - tr(((gradU) & (gradU)))); - Q.write(); + Info<< type() << " " << name_ << " output:" << nl + << " writing field " << Q.name() << nl + << endl; - Info<< type() << " output:" << nl - << " writing " << Q.name() << " field" << nl << endl; + Q.write(); } } diff --git a/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C b/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C index 5082536734..8c61185158 100644 --- a/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C +++ b/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C @@ -322,6 +322,10 @@ void Foam::pressureTools::write() pResult == convertToCoeff(rhoScale(p)*p + pDyn(p) + pRef()); + Info<< type() << " " << name_ << " output:" << nl + << " writing field " << pResult.name() << nl + << endl; + pResult.write(); } } diff --git a/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C index 22942fa266..61c68bdd5b 100644 --- a/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C +++ b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C @@ -234,7 +234,7 @@ void Foam::wallShearStress::write() if (log_) { - Info<< type() << " output:" << nl; + Info<< type() << " " << name_ << " output:" << nl; } @@ -265,7 +265,8 @@ void Foam::wallShearStress::write() if (log_) { - Info<< endl; + Info<< " 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 1b4bc680af..00c7e36087 100644 --- a/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C +++ b/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C @@ -282,7 +282,7 @@ void Foam::yPlusLES::write() if (log_) { - Info<< type() << " output:" << nl; + Info<< type() << " " << name_ << " output:" << nl; } if (phi.dimensions() == dimMass/dimTime) @@ -296,7 +296,8 @@ void Foam::yPlusLES::write() if (log_) { - Info<< endl; + Info<< " 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 13412a300e..0bd98fc7f0 100644 --- a/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C +++ b/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C @@ -267,7 +267,7 @@ void Foam::yPlusRAS::write() if (log_) { - Info<< type() << " output:" << nl; + Info<< type() << " " << name_ << " output:" << nl; } if (phi.dimensions() == dimMass/dimTime) @@ -281,7 +281,8 @@ void Foam::yPlusRAS::write() if (log_) { - Info<< endl; + Info<< " writing field " << yPlusRAS.name() << nl + << endl; } yPlusRAS.write();