From 95b7a3be188631b18fda9e0b413410ac62641b0b Mon Sep 17 00:00:00 2001 From: andy <andy> Date: Wed, 5 Oct 2011 10:31:30 +0100 Subject: [PATCH] ENH: Updated behaviour of 'log' in forces function object - values always written to file - values only written to screen if log = true --- .../functionObjects/forces/forces/forces.C | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/postProcessing/functionObjects/forces/forces/forces.C b/src/postProcessing/functionObjects/forces/forces/forces.C index b23a6d2328e..1dd26906b74 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.C +++ b/src/postProcessing/functionObjects/forces/forces/forces.C @@ -428,36 +428,43 @@ void Foam::forces::write() Info<< "forces output:" << nl << " forces(pressure, viscous)" << fm.first() << nl << " moment(pressure, viscous)" << fm.second() << nl; + } - forcesFilePtr_() << obr_.time().value() << tab << fm; - - if (localSystem_) - { - forcesMoments fmLocal; + forcesFilePtr_() << obr_.time().value() << tab << fm; - fmLocal.first().first() = - coordSys_.localVector(fm.first().first()); + if (localSystem_) + { + forcesMoments fmLocal; - fmLocal.first().second() = - coordSys_.localVector(fm.first().second()); + fmLocal.first().first() = + coordSys_.localVector(fm.first().first()); - fmLocal.second().first() = - coordSys_.localVector(fm.second().first()); + fmLocal.first().second() = + coordSys_.localVector(fm.first().second()); - fmLocal.second().second() = - coordSys_.localVector(fm.second().second()); + fmLocal.second().first() = + coordSys_.localVector(fm.second().first()); - forcesFilePtr_() << tab << fmLocal; + fmLocal.second().second() = + coordSys_.localVector(fm.second().second()); + forcesFilePtr_() << tab << fmLocal; + if (log_) + { Info<< " local:" << nl << " forces(pressure, viscous)" << fmLocal.first() << nl << " moment(pressure, viscous)" << fmLocal.second() << nl; } + } + + + forcesFilePtr_() << endl; - forcesFilePtr_() << endl; + if (log_) + { Info<< endl; } } -- GitLab