Public Member Functions | Private Member Functions | Private Attributes
OutputFilterFunctionObject< OutputFilter > Class Template Reference

A functionObject wrapper around OutputFilter to allow them to be created via the functions entry within controlDict. More...

Inheritance diagram for OutputFilterFunctionObject< OutputFilter >:
Inheritance graph
[legend]
Collaboration diagram for OutputFilterFunctionObject< OutputFilter >:
Collaboration graph
[legend]

Public Member Functions

 TypeName (OutputFilter::typeName_())
 Runtime type information. More...
 
 OutputFilterFunctionObject (const word &name, const Time &, const dictionary &)
 Construct from components. More...
 
virtual const Timetime () const
 Return time database. More...
 
virtual const dictionarydict () const
 Return the input dictionary. More...
 
virtual const wordregionName () const
 Return the region name. More...
 
virtual const worddictName () const
 Return the optional dictionary name. More...
 
virtual bool enabled () const
 Return the enabled flag. More...
 
virtual const outputFilterOutputControloutputControl () const
 Return the output control object. More...
 
virtual const OutputFilter & outputFilter () const
 Return the output filter. More...
 
virtual void on ()
 Switch the function object on. More...
 
virtual void off ()
 Switch the function object off. More...
 
virtual bool start ()
 Called at the start of the time-loop. More...
 
virtual bool execute (const bool forceWrite)
 Called at each ++ or += of the time-loop. More...
 
virtual bool end ()
 Called when Time::run() determines that the time-loop exits. More...
 
virtual bool timeSet ()
 Called when time was set at the end of the Time::operator++. More...
 
virtual bool adjustTimeStep ()
 Called at the end of Time::adjustDeltaT() if adjustTime is true. More...
 
virtual bool read (const dictionary &)
 Read and set the function object if its data have changed. More...
 
virtual void updateMesh (const mapPolyMesh &mpm)
 Update for changes of mesh. More...
 
virtual void movePoints (const polyMesh &mesh)
 Update for changes of mesh. More...
 
- Public Member Functions inherited from functionObject
virtual const wordtype () const =0
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, functionObject, dictionary,(const word &name, const Time &t, const dictionary &dict),(name, t, dict))
 
 functionObject (const word &name)
 Construct from components. More...
 
autoPtr< functionObjectclone () const
 Return clone. More...
 
virtual ~functionObject ()
 Destructor. More...
 
virtual const wordname () const
 Name. More...
 

Private Member Functions

void readDict ()
 Read relevant dictionary entries. More...
 
void allocateFilter ()
 Creates most of the data associated with this object. More...
 
void destroyFilter ()
 Destroys most of the data associated with this object. More...
 
bool active () const
 Returns true if active (enabled and within time bounds) More...
 
 OutputFilterFunctionObject (const OutputFilterFunctionObject &)
 Disallow default bitwise copy construct. More...
 
void operator= (const OutputFilterFunctionObject &)
 Disallow default bitwise assignment. More...
 

Private Attributes

const Timetime_
 Reference to the time database. More...
 
dictionary dict_
 Input dictionary. More...
 
word regionName_
 Name of region - defaults to name of polyMesh::defaultRegion. More...
 
word dictName_
 Dictionary name to supply required inputs. More...
 
bool enabled_
 Switch for the execution - defaults to 'yes/on'. More...
 
bool storeFilter_
 Switch to store filter in between writes or use on-the-fly. More...
 
scalar timeStart_
 Activation time - defaults to -VGREAT. More...
 
scalar timeEnd_
 De-activation time - defaults to VGREAT. More...
 
label nStepsToStartTimeChange_
 Number of steps before the dumping time in which the deltaT. More...
 
outputFilterOutputControl outputControl_
 Output controls. More...
 
outputFilterOutputControl evaluateControl_
 Evaluate controls. More...
 
autoPtr< OutputFilter > ptr_
 Pointer to the output filter. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from functionObject
static autoPtr< functionObjectNew (const word &name, const Time &, const dictionary &)
 Select from dictionary, based on its "type" entry. More...
 
- Static Public Attributes inherited from functionObject
static int debug
 

Detailed Description

template<class OutputFilter>
class Foam::OutputFilterFunctionObject< OutputFilter >

A functionObject wrapper around OutputFilter to allow them to be created via the functions entry within controlDict.

Note
Since the timeIndex is used directly from Foam::Time, it is unaffected by user-time conversions. For example, Foam::engineTime might cause writeInterval to be degrees crank angle, but the functionObject execution interval would still be in timestep.

The function object can be limited to operate within a time range using the timeStart and timEnd options. All objects are read (and the OutputFilter allocated) on construction. However, if a timeEnd is supplied, the object will call the 'end' function of the filter at the timeEnd time and destroy the filter. Any other callback (execute(), write(), timeSet() etc) will only operate if within the timeStart, timeEnd time range. Note that the time range uses 0.5 * deltaT as a comparison tolerance to account for precision errors.

Source files

Definition at line 67 of file OutputFilterFunctionObject.H.

Constructor & Destructor Documentation

◆ OutputFilterFunctionObject() [1/2]

OutputFilterFunctionObject ( const OutputFilterFunctionObject< OutputFilter > &  )
private

Disallow default bitwise copy construct.

◆ OutputFilterFunctionObject() [2/2]

OutputFilterFunctionObject ( const word name,
const Time t,
const dictionary dict 
)

Construct from components.

Definition at line 102 of file OutputFilterFunctionObject.C.

Member Function Documentation

◆ readDict()

void readDict
private

Read relevant dictionary entries.

Definition at line 35 of file OutputFilterFunctionObject.C.

◆ allocateFilter()

void allocateFilter
private

Creates most of the data associated with this object.

Definition at line 62 of file OutputFilterFunctionObject.C.

References Foam::name().

Here is the call graph for this function:

◆ destroyFilter()

void destroyFilter
private

Destroys most of the data associated with this object.

Definition at line 92 of file OutputFilterFunctionObject.C.

◆ active()

bool active
private

Returns true if active (enabled and within time bounds)

Definition at line 48 of file OutputFilterFunctionObject.C.

◆ operator=()

void operator= ( const OutputFilterFunctionObject< OutputFilter > &  )
private

Disallow default bitwise assignment.

◆ TypeName()

TypeName ( OutputFilter::typeName_()  )

Runtime type information.

◆ time()

virtual const Time& time ( ) const
inlinevirtual

Return time database.

Definition at line 159 of file OutputFilterFunctionObject.H.

References OutputFilterFunctionObject< OutputFilter >::time_.

◆ dict()

virtual const dictionary& dict ( ) const
inlinevirtual

Return the input dictionary.

Definition at line 165 of file OutputFilterFunctionObject.H.

References OutputFilterFunctionObject< OutputFilter >::dict_.

◆ regionName()

virtual const word& regionName ( ) const
inlinevirtual

Return the region name.

Definition at line 171 of file OutputFilterFunctionObject.H.

References OutputFilterFunctionObject< OutputFilter >::regionName_.

◆ dictName()

virtual const word& dictName ( ) const
inlinevirtual

Return the optional dictionary name.

Definition at line 177 of file OutputFilterFunctionObject.H.

References OutputFilterFunctionObject< OutputFilter >::dictName_.

◆ enabled()

virtual bool enabled ( ) const
inlinevirtual

Return the enabled flag.

Definition at line 183 of file OutputFilterFunctionObject.H.

References OutputFilterFunctionObject< OutputFilter >::enabled_.

◆ outputControl()

virtual const outputFilterOutputControl& outputControl ( ) const
inlinevirtual

Return the output control object.

Definition at line 189 of file OutputFilterFunctionObject.H.

References OutputFilterFunctionObject< OutputFilter >::outputControl_.

◆ outputFilter()

virtual const OutputFilter& outputFilter ( ) const
inlinevirtual

Return the output filter.

Definition at line 195 of file OutputFilterFunctionObject.H.

References OutputFilterFunctionObject< OutputFilter >::ptr_.

◆ on()

void on
virtual

Switch the function object on.

Definition at line 131 of file OutputFilterFunctionObject.C.

◆ off()

void off
virtual

Switch the function object off.

Definition at line 138 of file OutputFilterFunctionObject.C.

◆ start()

bool start
virtual

Called at the start of the time-loop.

Implements functionObject.

Definition at line 145 of file OutputFilterFunctionObject.C.

◆ execute()

bool execute ( const bool  forceWrite)
virtual

Called at each ++ or += of the time-loop.

Implements functionObject.

Definition at line 160 of file OutputFilterFunctionObject.C.

◆ end()

bool end
virtual

Called when Time::run() determines that the time-loop exits.

Reimplemented from functionObject.

Definition at line 199 of file OutputFilterFunctionObject.C.

◆ timeSet()

bool timeSet
virtual

Called when time was set at the end of the Time::operator++.

Reimplemented from functionObject.

Definition at line 221 of file OutputFilterFunctionObject.C.

◆ adjustTimeStep()

bool adjustTimeStep
virtual

Called at the end of Time::adjustDeltaT() if adjustTime is true.

Reimplemented from functionObject.

Definition at line 233 of file OutputFilterFunctionObject.C.

References Foam::max().

Here is the call graph for this function:

◆ read()

bool read ( const dictionary dict)
virtual

Read and set the function object if its data have changed.

Implements functionObject.

Definition at line 283 of file OutputFilterFunctionObject.C.

References dict.

◆ updateMesh()

void updateMesh ( const mapPolyMesh mpm)
virtual

Update for changes of mesh.

Implements functionObject.

Definition at line 303 of file OutputFilterFunctionObject.C.

References mapPolyMesh::mesh(), and IOobject::name().

Here is the call graph for this function:

◆ movePoints()

void movePoints ( const polyMesh mesh)
virtual

Update for changes of mesh.

Implements functionObject.

Definition at line 316 of file OutputFilterFunctionObject.C.

References mesh.

Field Documentation

◆ time_

const Time& time_
private

Reference to the time database.

Definition at line 74 of file OutputFilterFunctionObject.H.

Referenced by OutputFilterFunctionObject< OutputFilter >::time().

◆ dict_

dictionary dict_
private

Input dictionary.

Definition at line 77 of file OutputFilterFunctionObject.H.

Referenced by OutputFilterFunctionObject< OutputFilter >::dict().

◆ regionName_

word regionName_
private

Name of region - defaults to name of polyMesh::defaultRegion.

Definition at line 83 of file OutputFilterFunctionObject.H.

Referenced by OutputFilterFunctionObject< OutputFilter >::regionName().

◆ dictName_

word dictName_
private

Dictionary name to supply required inputs.

Definition at line 86 of file OutputFilterFunctionObject.H.

Referenced by OutputFilterFunctionObject< OutputFilter >::dictName().

◆ enabled_

bool enabled_
private

Switch for the execution - defaults to 'yes/on'.

Definition at line 89 of file OutputFilterFunctionObject.H.

Referenced by OutputFilterFunctionObject< OutputFilter >::enabled().

◆ storeFilter_

bool storeFilter_
private

Switch to store filter in between writes or use on-the-fly.

construction - defaults to true

Definition at line 93 of file OutputFilterFunctionObject.H.

◆ timeStart_

scalar timeStart_
private

Activation time - defaults to -VGREAT.

Definition at line 96 of file OutputFilterFunctionObject.H.

◆ timeEnd_

scalar timeEnd_
private

De-activation time - defaults to VGREAT.

Definition at line 99 of file OutputFilterFunctionObject.H.

◆ nStepsToStartTimeChange_

label nStepsToStartTimeChange_
private

Number of steps before the dumping time in which the deltaT.

will start to change (valid for ocAdjustableTime)

Definition at line 103 of file OutputFilterFunctionObject.H.

◆ outputControl_

outputFilterOutputControl outputControl_
private

Output controls.

Definition at line 107 of file OutputFilterFunctionObject.H.

Referenced by OutputFilterFunctionObject< OutputFilter >::outputControl().

◆ evaluateControl_

outputFilterOutputControl evaluateControl_
private

Evaluate controls.

Definition at line 110 of file OutputFilterFunctionObject.H.

◆ ptr_

autoPtr<OutputFilter> ptr_
private

Pointer to the output filter.

Definition at line 113 of file OutputFilterFunctionObject.H.

Referenced by OutputFilterFunctionObject< OutputFilter >::outputFilter().


The documentation for this class was generated from the following files: