diff --git a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C index 15a32c1e8e3b979d53da4aefac77e0e65afe4682..4e3bf3fad6849ce9daa4d5c6189716b91bd139f8 100644 --- a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C +++ b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C @@ -50,8 +50,7 @@ Foam::OutputFilterFunctionObject<OutputFilter>::OutputFilterFunctionObject const dictionary& dict ) : - functionObject(), - name_(name), + functionObject(name), time_(t), dict_(dict), regionName_(polyMesh::defaultRegion), @@ -92,7 +91,7 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::start() ( new IOOutputFilter<OutputFilter> ( - name_, + name(), time_.lookupObject<objectRegistry>(regionName_), dictName_ ) @@ -104,7 +103,7 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::start() ( new OutputFilter ( - name_, + name(), time_.lookupObject<objectRegistry>(regionName_), dict_ ) diff --git a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H index 9ac00bd060f7d650f216ad162595af56ca7a31f6..f6c183e803cb0aadf64d2fe346faa8d975e09d10 100644 --- a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H +++ b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H @@ -63,9 +63,6 @@ class OutputFilterFunctionObject { // Private data - //- Output filter name - word name_; - //- Reference to the time database const Time& time_; @@ -121,12 +118,6 @@ public: // Access - //- Return name - virtual const word& name() const - { - return name_; - } - //- Return time database virtual const Time& time() const { diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C index a731621ff676fae227b64f15f4387b2a006170dd..3157cea04bb4dfcc8f5ef70dcc0b49fa984af62b 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C @@ -36,7 +36,9 @@ int Foam::functionObject::debug(Foam::debug::debugSwitch("functionObject", 0)); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::functionObject::functionObject() +Foam::functionObject::functionObject(const word& name) +: + name_(name) {} @@ -103,6 +105,12 @@ Foam::functionObject::~functionObject() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +const Foam::word& Foam::functionObject::name() const +{ + return name_; +} + + bool Foam::functionObject::end() { return execute(); diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H index 94a2f7aea4848f65b2279142f4dc0eb8e2c9b642..8757c3adbcc0e5547469458b955e8d7b8fd155ec 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H @@ -57,6 +57,12 @@ class Time; class functionObject { + // Private data + + //- Name + const word name_; + + // Private Member Functions //- Disallow default bitwise copy construct @@ -88,8 +94,8 @@ public: // Constructors - //- Construct null - functionObject(); + //- Construct from components + functionObject(const word& name); //- Return clone autoPtr<functionObject> clone() const @@ -137,6 +143,9 @@ public: // Member Functions + //- Name + virtual const word& name() const; + //- Called at the start of the time-loop virtual bool start() = 0; diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H index ea2c43adf328e285fcde866a85a9997449ce8353..0b3a0354641d0d90d6833fda92429298fdc3614b 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H @@ -133,6 +133,9 @@ public: //- Return true if the List is empty (ie, size() is zero). using PtrList<functionObject>::empty; + //- Access to the functionObjects + using PtrList<functionObject>::operator[]; + //- Clear the list of function objects virtual void clear();