Commit 95b7a3be authored by andy's avatar andy
Browse files

ENH: Updated behaviour of 'log' in forces function object

- values always written to file
- values only written to screen if log = true
parent 45ca32a7
......@@ -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;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment