Utilities patchAverage and patchIntegrate replaced by postProcess

e.g.
    postProcess -func 'patchAverage(name=inlet,p)'
    postProcess -func 'patchIntegrate(name=inlet,p)'
This commit is contained in:
Henry Weller
2016-06-12 22:32:15 +01:00
parent f49025ac86
commit 41c2e4bc11
16 changed files with 106 additions and 441 deletions

View File

@ -36,12 +36,15 @@ namespace Foam
defineRunTimeSelectionTable(functionObject, dictionary);
}
bool Foam::functionObject::postProcess(false);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::functionObject::functionObject(const word& name)
:
name_(name)
name_(name),
log(postProcess)
{}
@ -120,6 +123,17 @@ const Foam::word& Foam::functionObject::name() const
}
bool Foam::functionObject::read(const dictionary& dict)
{
if (!postProcess)
{
log = dict.lookupOrDefault<Switch>("log", true);
}
return true;
}
bool Foam::functionObject::end()
{
return execute() && write();

View File

@ -112,6 +112,7 @@ SourceFiles
#include "typeInfo.H"
#include "autoPtr.H"
#include "Switch.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -152,6 +153,12 @@ public:
static int debug;
//- Global post-processing mode switch
static bool postProcess;
//- Switch write log to Info
Switch log;
// Declare run-time constructor selection tables
@ -199,7 +206,7 @@ public:
const word& name() const;
//- Read and set the function object if its data have changed
virtual bool read(const dictionary&) = 0;
virtual bool read(const dictionary&);
//- Called at each ++ or += of the time-loop.
// postProcess overrides the usual executeControl behaviour and

View File

@ -73,6 +73,9 @@ if (argList::postProcess(argc, argv))
#include "addRegionOption.H"
#include "addFunctionObjectOptions.H"
// Set functionObject post-processing mode
functionObject::postProcess = true;
#include "setRootCase.H"
if (args.optionFound("list"))

View File

@ -105,8 +105,7 @@ Foam::functionObjects::regionFunctionObject::regionFunctionObject
(
dict.lookupOrDefault("region", polyMesh::defaultRegion)
)
),
log(true)
)
{}
@ -119,8 +118,7 @@ Foam::functionObjects::regionFunctionObject::regionFunctionObject
:
functionObject(name),
time_(obr.time()),
obr_(obr),
log(true)
obr_(obr)
{}
@ -134,9 +132,7 @@ Foam::functionObjects::regionFunctionObject::~regionFunctionObject()
bool Foam::functionObjects::regionFunctionObject::read(const dictionary& dict)
{
log = dict.lookupOrDefault<Switch>("log", true);
return true;
return functionObject::read(dict);
}

View File

@ -40,7 +40,6 @@ SourceFiles
#define functionObjects_regionFunctionObject_H
#include "functionObject.H"
#include "Switch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -115,9 +114,6 @@ public:
//- Runtime type information
TypeName("regionFunctionObject");
//- Switch write log to Info
Switch log;
// Constructors