opened up function obect interface

This commit is contained in:
andy
2009-07-06 12:31:16 +01:00
parent 383823e69d
commit b1d2ecd38a
2 changed files with 89 additions and 20 deletions

View File

@ -63,17 +63,28 @@ class OutputFilterFunctionObject
{ {
// Private data // Private data
//- Output filter name
word name_; word name_;
//- Reference to the time database
const Time& time_; const Time& time_;
//- Input dictionary
dictionary dict_; dictionary dict_;
//- Name of region
word regionName_; word regionName_;
//- Optional dictionary name to supply required inputs
word dictName_; word dictName_;
//- Switch for the execution of the functionObject //- Switch for the execution of the functionObject
bool enabled_; bool enabled_;
//- Output controls
outputFilterOutputControl outputControl_; outputFilterOutputControl outputControl_;
//- Pointer to the output filter
autoPtr<OutputFilter> ptr_; autoPtr<OutputFilter> ptr_;
@ -108,31 +119,78 @@ public:
// Member Functions // Member Functions
//- Return name // Access
virtual const word& name() const
{
return name_;
}
//- Switch the function object on //- Return name
virtual void on(); virtual const word& name() const
{
return name_;
}
//- Switch the function object off //- Return time database
virtual void off(); 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 // Function object control
virtual bool start();
//- Called at each ++ or += of the time-loop //- Switch the function object on
virtual bool execute(); virtual void on();
//- Called when Time::run() determines that the time-loop exits //- Switch the function object off
virtual bool end(); virtual void off();
//- Read and set the function object if its data have changed //- Called at the start of the time-loop
virtual bool read(const dictionary&); 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&);
}; };

View File

@ -175,9 +175,8 @@ public:
); );
// Destructor //- Destructor
virtual ~probes();
virtual ~probes();
// Member Functions // Member Functions
@ -188,6 +187,18 @@ public:
return name_; 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) //- Cells to be probed (obtained from the locations)
const labelList& cells() const const labelList& cells() const
{ {