functionObjects: rewritten to all be derived from 'functionObject'

- Avoids the need for the 'OutputFilterFunctionObject' wrapper
  - Time-control for execution and writing is now provided by the
    'timeControlFunctionObject' which instantiates the processing
    'functionObject' and controls its operation.
  - Alternative time-control functionObjects can now be written and
    selected at run-time without the need to compile wrapped version of
    EVERY existing functionObject which would have been required in the
    old structure.
  - The separation of 'execute' and 'write' functions is now formalized in the
    'functionObject' base-class and all derived classes implement the
    two functions.
  - Unnecessary implementations of functions with appropriate defaults
    in the 'functionObject' base-class have been removed reducing
    clutter and simplifying implementation of new functionObjects.
  - The 'coded' 'functionObject' has also been updated, simplified and tested.
  - Further simplification is now possible by creating some general
    intermediate classes derived from 'functionObject'.
This commit is contained in:
Henry Weller
2016-05-15 16:40:01 +01:00
parent 1441f8cab0
commit 91aba2db2e
230 changed files with 2731 additions and 8756 deletions

View File

@ -27,6 +27,7 @@ License
#include "Time.H"
#include "mapPolyMesh.H"
#include "argList.H"
#include "timeControlFunctionObject.H"
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
@ -354,7 +355,21 @@ bool Foam::functionObjectList::read()
FatalIOError.throwExceptions();
try
{
foPtr = functionObject::New(key, time_, dict);
if
(
dict.found("writeControl")
|| dict.found("outputControl")
)
{
foPtr.set
(
new functionObjects::timeControl(key, time_, dict)
);
}
else
{
foPtr = functionObject::New(key, time_, dict);
}
}
catch (Foam::IOerror& ioErr)
{

View File

@ -29,7 +29,8 @@ Description
that is called for each object.
See Also
Foam::functionObject and Foam::OutputFilterFunctionObject
Foam::functionObject
Foam::functionObjects::timeControl
SourceFiles
functionObjectList.C
@ -158,6 +159,9 @@ public:
//- Find the ID of a given function object by name
label findObjectID(const word& name) const;
//- Read and set the function objects if their data have changed
bool read();
//- Switch the function objects on
void on();
@ -184,9 +188,6 @@ public:
//- Called at the end of Time::adjustDeltaT() if adjustTime is true
bool adjustTimeStep();
//- Read and set the function objects if their data have changed
bool read();
//- Update for changes of mesh
void updateMesh(const mapPolyMesh& mpm);