functionObject: Log by default to stdout when in postProcess mode, not otherwise

This change formalises the usage of the "log" keyword in function
objects. By default, logging to stdout is activated when running
"postProcess" or "<solver> -postProcess", and deactivated when a
function is being executed as part of a run.

This behaviour can now be overridden in the function object dictionary
when operating in either mode.
This commit is contained in:
Will Bainbridge
2019-11-27 15:45:53 +00:00
parent 9675107f7e
commit 7d229e7026
9 changed files with 5 additions and 16 deletions

View File

@ -12,6 +12,4 @@ libs ("libforces.so");
writeControl timeStep;
writeInterval 1;
log off;
// ************************************************************************* //

View File

@ -13,7 +13,6 @@ writeControl timeStep;
writeInterval 1;
writeFields false;
log false;
regionType all;
operation max;

View File

@ -13,7 +13,6 @@ writeControl timeStep;
writeInterval 1;
writeFields false;
log false;
regionType all;
operation max;

View File

@ -12,9 +12,6 @@ libs ("libfieldFunctionObjects.so");
writeControl timeStep;
writeInterval 1;
write true;
log false;
mode magnitude;
// ************************************************************************* //

View File

@ -11,6 +11,5 @@ libs ("libfieldFunctionObjects.so");
executeControl writeTime;
writeControl writeTime;
log false;
// ************************************************************************* //

View File

@ -9,11 +9,10 @@
type fieldValueDelta;
libs ("libfieldFunctionObjects.so");
operation subtract;
writeControl timeStep;
writeInterval 1
log false;
operation subtract;
region1
{

View File

@ -13,6 +13,5 @@ writeControl timeStep;
writeInterval 1;
writeFields false;
log false;
// ************************************************************************* //

View File

@ -126,9 +126,10 @@ const Foam::word& Foam::functionObject::name() const
bool Foam::functionObject::read(const dictionary& dict)
{
log = dict.lookupOrDefault<Switch>("log", postProcess);
if (!postProcess)
{
log = dict.lookupOrDefault<Switch>("log", true);
executeAtStart_ = dict.lookupOrDefault<Switch>("executeAtStart", true);
}

View File

@ -39,7 +39,6 @@ Description
type fieldMinMax;
libs ("libfieldFunctionObjects.so");
...
write yes;
log yes;
location yes;
mode magnitude;
@ -55,7 +54,6 @@ Usage
\table
Property | Description | Required | Default value
type | type name: fieldMinMax | yes |
write | write min/max data to file | no | yes
log | write min/max data to standard output | no | no
location | write location of the min/max value | no | yes
mode | calculation mode: magnitude or component | no | magnitude