From b1d2ecd38a6133356d964343ab300fe789d45b10 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 6 Jul 2009 12:31:16 +0100 Subject: [PATCH] opened up function obect interface --- .../OutputFilterFunctionObject.H | 92 +++++++++++++++---- src/sampling/probes/probes.H | 17 +++- 2 files changed, 89 insertions(+), 20 deletions(-) diff --git a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H index 5ab4ebbece..9ac00bd060 100644 --- a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H +++ b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H @@ -63,17 +63,28 @@ class OutputFilterFunctionObject { // Private data + //- Output filter name word name_; + + //- Reference to the time database const Time& time_; + + //- Input dictionary dictionary dict_; + + //- Name of region word regionName_; + + //- Optional dictionary name to supply required inputs word dictName_; //- Switch for the execution of the functionObject bool enabled_; + //- Output controls outputFilterOutputControl outputControl_; + //- Pointer to the output filter autoPtr ptr_; @@ -108,31 +119,78 @@ public: // Member Functions - //- Return name - virtual const word& name() const - { - return name_; - } + // Access - //- Switch the function object on - virtual void on(); + //- Return name + virtual const word& name() const + { + return name_; + } - //- Switch the function object off - virtual void off(); + //- Return time database + virtual const Time& time() const + { + return time_; + } + + //- Return the input dictionary + virtual const dictionary& dict() const + { + return dict_; + } + + //- Return the region name + virtual const word& regionName() const + { + return regionName_; + } + + //- Return the optional dictionary name + virtual const word& dictName() const + { + return dictName_; + } + + //- Return the enabled flag + virtual bool enabled() const + { + return enabled_; + } + + //- Return the output control object + virtual const outputFilterOutputControl& outputControl() const + { + return outputControl_; + } + + //- Return the output filter + virtual const OutputFilter& outputFilter() const + { + return ptr_(); + } - //- Called at the start of the time-loop - virtual bool start(); + // Function object control - //- Called at each ++ or += of the time-loop - virtual bool execute(); + //- Switch the function object on + virtual void on(); - //- Called when Time::run() determines that the time-loop exits - virtual bool end(); + //- Switch the function object off + virtual void off(); - //- Read and set the function object if its data have changed - virtual bool read(const dictionary&); + //- Called at the start of the time-loop + virtual bool start(); + + //- Called at each ++ or += of the time-loop + virtual bool execute(); + + //- Called when Time::run() determines that the time-loop exits + virtual bool end(); + + + //- Read and set the function object if its data have changed + virtual bool read(const dictionary&); }; diff --git a/src/sampling/probes/probes.H b/src/sampling/probes/probes.H index 33e4f39e25..11a7f581c1 100644 --- a/src/sampling/probes/probes.H +++ b/src/sampling/probes/probes.H @@ -175,9 +175,8 @@ public: ); - // Destructor - - virtual ~probes(); + //- Destructor + virtual ~probes(); // Member Functions @@ -188,6 +187,18 @@ public: return name_; } + //- Return names of fields to probe + virtual const wordList& fieldNames() const + { + return fieldNames_; + } + + //- Return locations to probe + virtual const vectorField& probeLocations() const + { + return probeLocations_; + } + //- Cells to be probed (obtained from the locations) const labelList& cells() const {