functionObject Class Referenceabstract

Abstract base-class for Time/database function objects. More...

Inheritance diagram for functionObject:
[legend]
Collaboration diagram for functionObject:
[legend]

Classes

class  unavailableFunctionObject
 Abstract functionObject to report when a real version is unavailable. More...
 

Public Member Functions

 declareRunTimeSelectionTable (autoPtr, functionObject, dictionary,(const word &name, const Time &runTime, const dictionary &dict),(name, runTime, dict))
 
 functionObject (const word &name, const bool withNamePrefix=defaultUseNamePrefix)
 Construct from components. More...
 
autoPtr< functionObjectclone () const
 Return clone. More...
 
virtual ~functionObject ()=default
 Destructor. More...
 
virtual const wordtype () const =0
 Runtime type information. More...
 
const wordname () const noexcept
 Return the name of this functionObject. More...
 
bool useNamePrefix () const noexcept
 Return the flag for adding a scoping name prefix. More...
 
bool useNamePrefix (bool on) noexcept
 Modify the flag for adding a scoping name prefix. More...
 
virtual bool read (const dictionary &dict)
 Read and set the function object if its data have changed. More...
 
virtual bool execute ()=0
 Called at each ++ or += of the time-loop. More...
 
virtual bool execute (const label subIndex)
 Execute using the specified subIndex. More...
 
virtual bool write ()=0
 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 adjustTimeStep ()
 Called at the end of Time::adjustDeltaT() if adjustTime is true. More...
 
virtual bool filesModified () const
 Did any file get changed during execution? 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...
 

Static Public Member Functions

static autoPtr< functionObjectNew (const word &name, const Time &runTime, const dictionary &dict)
 Select from dictionary, based on its "type" entry. More...
 

Public Attributes

bool log
 Flag to write log into Info. More...
 

Static Public Attributes

static int debug
 Flag to execute debug content. More...
 
static bool postProcess
 Global post-processing mode switch. More...
 
static bool defaultUseNamePrefix
 Global default for useNamePrefix. More...
 
static word outputPrefix
 Directory prefix. More...
 

Protected Member Functions

word scopedName (const word &name) const
 Return a scoped (prefixed) name. More...
 

Detailed Description

Abstract base-class for Time/database function objects.

See also
Source files

Definition at line 332 of file functionObject.H.

Constructor & Destructor Documentation

◆ functionObject()

functionObject ( const word name,
const bool  withNamePrefix = defaultUseNamePrefix 
)
explicit

Construct from components.

Definition at line 65 of file functionObject.C.

◆ ~functionObject()

virtual ~functionObject ( )
virtualdefault

Destructor.

Member Function Documentation

◆ scopedName()

Foam::word scopedName ( const word name) const
protected

Return a scoped (prefixed) name.

Used to construct local field names, controlled by useNamePrefix_

Definition at line 51 of file functionObject.C.

References functionObject::name(), and IOobject::scopedName().

Here is the call graph for this function:

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr  ,
functionObject  ,
dictionary  ,
(const word &name, const Time &runTime, const dictionary &dict ,
(name, runTime, dict  
)

◆ clone()

autoPtr<functionObject> clone ( ) const
inline

Return clone.

Definition at line 401 of file functionObject.H.

References NotImplemented.

◆ New()

Foam::autoPtr< Foam::functionObject > New ( const word name,
const Time runTime,
const dictionary dict 
)
static

Select from dictionary, based on its "type" entry.

Definition at line 79 of file functionObject.C.

References dictionary::csearchCompat(), DebugInfo, dict, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, FatalErrorInLookup, dictionary::get(), Time::libs(), Foam::name(), Foam::nl, dlLibraryTable::open(), and runTime.

Referenced by reactingEulerHtcModel::q(), multiRegion::read(), functionObjectList::read(), and codedFunctionObject::redirectFunctionObject().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ type()

virtual const word& type ( ) const
pure virtual

Runtime type information.

Referenced by extractEulerianParticles::checkFaceZone(), runTimeControl::execute(), surfaceInterpolate::execute(), surfaceDistance::execute(), fieldAverage::initialize(), multiRegion::read(), abort::read(), derivedFields::read(), particleDistribution::read(), limitFields::read(), syncObjects::sync(), wallBoundedStreamLine::track(), and multiFieldValue::write().

Here is the caller graph for this function:

◆ name()

const Foam::word & name ( ) const
noexcept

◆ useNamePrefix() [1/2]

bool useNamePrefix ( ) const
noexcept

Return the flag for adding a scoping name prefix.

Definition at line 149 of file functionObject.C.

◆ useNamePrefix() [2/2]

bool useNamePrefix ( bool  on)
noexcept

Modify the flag for adding a scoping name prefix.

Returns
previous value.

Definition at line 155 of file functionObject.C.

◆ read()

bool read ( const dictionary dict)
virtual

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

Reimplemented in surfaceFieldValue, volFieldValue, sampledSurfaces, vtkWrite, externalCoupled, fluxSummary, ObukhovLength, setFlow, ensightWrite, electricPotential, DMD, vtkCloud, fvExpressionField, sizeDistribution, heatTransferCoeff, dataCloud, multiFieldValue, nearWallFields, reference, limitFields, areaWrite, derivedFields, zeroGradient, randomise, regionFunctionObject, columnAverage, fieldValue, wallHeatFlux, hydrostaticPressure, readFields, moleFractions< ThermoType >, systemCall, fieldExpression, fieldsExpression, abort, setTimeStepFunctionObject, multiRegion, timeInfo, phaseForces, cloudInfo, setTimeStepFaRegionsFunctionObject, removeRegisteredObject, pointHistory, specieReactionRates< ChemistryModelType >, reactingEulerHtcModel, writeFreeSurface, stabilityBlendingFactor, propellerInfo, pressure, regionSizeDistribution, forces, fieldAverage, extractEulerianParticles, forceCoeffs, energyTransport, momentum, BilgerMixtureFraction, comfort, turbulenceFields, wallBoundedStreamLine, scalarTransport, Curle, streamLine, probes, mapFields, proudmanAcousticPower, log, sampledSets, fieldMinMax, interfaceHeight, pow, fieldExtents, blendingFactor, particleDistribution, timeControl, ddt2, streamLineBase, histogram, valueAverage, codedFunctionObject, solverInfo, reactionsSensitivityAnalysis< chemistryType >, age, continuityError, wallShearStress, momentumError, AMIWeights, thermoCoupleProbes, surfaceDistance, writeObjects, yPlus, DESModelRegions, surfaceInterpolate, CourantNo, PecletNo, filmFlux, patchProbes, icoUncoupledKinematicCloud, energySpectrum, syncObjects, writeCellCentres, timeActivatedFileUpdate, processorField, writeCellVolumes, XiReactionRate, sixDoFRigidBodyState, runTimeControl, dsmcFields, and writeDictionary.

Definition at line 163 of file functionObject.C.

References dict, dictionary::getOrDefault(), keyType::LITERAL, and Foam::log().

Referenced by setTimeStepFaRegionsFunctionObject::read(), timeInfo::read(), timeActivatedFileUpdate::read(), multiRegion::read(), abort::read(), setTimeStepFunctionObject::read(), syncObjects::read(), filmFlux::read(), systemCall::read(), writeObjects::read(), regionFunctionObject::read(), codedFunctionObject::read(), functionObjectList::read(), externalCoupled::read(), and vtkWrite::read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ execute() [1/2]

virtual bool execute ( )
pure virtual

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

postProcess overrides the usual executeControl behaviour and forces execution (used in post-processing mode)

Implemented in propellerInfo, functionObject::unavailableFunctionObject, forces, regionSizeDistribution, sampledSurfaces, vtkWrite, fieldAverage, extractEulerianParticles, externalCoupled, forceCoeffs, energyTransport, fluxSummary, momentum, ObukhovLength, setFlow, ensightWrite, BilgerMixtureFraction, electricPotential, comfort, turbulenceFields, scalarTransport, DMD, vtkCloud, Curle, fvExpressionField, sizeDistribution, probes, mapFields, proudmanAcousticPower, sampledSets, fieldMinMax, interfaceHeight, dataCloud, multiFieldValue, nearWallFields, fieldExtents, limitFields, areaWrite, particleDistribution, ddt2, streamLineBase, histogram, valueAverage, solverInfo, reactionsSensitivityAnalysis< chemistryType >, age, derivedFields, zeroGradient, continuityError, wallShearStress, codedFunctionObject, timeControl, columnAverage, fieldValue, momentumError, wallHeatFlux, AMIWeights, hydrostaticPressure, readFields, surfaceDistance, thermoCoupleProbes, writeObjects, moleFractions< ThermoType >, yPlus, DESModelRegions, surfaceInterpolate, systemCall, filmFlux, fieldExpression, icoUncoupledKinematicCloud, fieldsExpression, energySpectrum, syncObjects, writeCellCentres, abort, setTimeStepFunctionObject, multiRegion, timeActivatedFileUpdate, processorField, writeCellVolumes, XiReactionRate, timeInfo, phaseForces, cloudInfo, sixDoFRigidBodyState, setTimeStepFaRegionsFunctionObject, runTimeControl, removeRegisteredObject, dsmcFields, writeDictionary, specieReactionRates< ChemistryModelType >, pointHistory, parProfiling, and writeFreeSurface.

◆ execute() [2/2]

bool execute ( const label  subIndex)
virtual

Execute using the specified subIndex.

The base implementation is a no-op.

Parameters
subIndexan execution sub-index corresponding to a sub-cycle or something similar.

Reimplemented in externalCoupled, and timeControl.

Definition at line 186 of file functionObject.C.

◆ write()

virtual bool write ( )
pure virtual

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

postProcess overrides the usual writeControl behaviour and forces writing always (used in post-processing mode)

Implemented in surfaceFieldValue, stabilityBlendingFactor, propellerInfo, functionObject::unavailableFunctionObject, forces, regionSizeDistribution, volFieldValue, sampledSurfaces, vtkWrite, fieldAverage, extractEulerianParticles, externalCoupled, forceCoeffs, energyTransport, fluxSummary, momentum, ObukhovLength, setFlow, BilgerMixtureFraction, ensightWrite, electricPotential, comfort, turbulenceFields, scalarTransport, DMD, vtkCloud, Curle, fvExpressionField, sizeDistribution, probes, mapFields, proudmanAcousticPower, sampledSets, interfaceHeight, fieldMinMax, dataCloud, multiFieldValue, nearWallFields, fieldExtents, limitFields, areaWrite, blendingFactor, particleDistribution, histogram, ddt2, streamLineBase, valueAverage, solverInfo, reactionsSensitivityAnalysis< chemistryType >, age, derivedFields, components, zeroGradient, continuityError, timeControl, codedFunctionObject, wallShearStress, columnAverage, fieldValue, momentumError, wallHeatFlux, AMIWeights, hydrostaticPressure, readFields, surfaceDistance, writeObjects, moleFractions< ThermoType >, yPlus, DESModelRegions, surfaceInterpolate, thermoCoupleProbes, systemCall, div, filmFlux, fieldExpression, icoUncoupledKinematicCloud, patchProbes, fieldsExpression, energySpectrum, syncObjects, writeCellCentres, abort, setTimeStepFunctionObject, multiRegion, timeActivatedFileUpdate, processorField, writeCellVolumes, XiReactionRate, timeInfo, phaseForces, cloudInfo, sixDoFRigidBodyState, setTimeStepFaRegionsFunctionObject, runTimeControl, removeRegisteredObject, dsmcFields, writeDictionary, pointHistory, specieReactionRates< ChemistryModelType >, parProfiling, and writeFreeSurface.

◆ end()

bool end ( )
virtual

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

The base implementation is a no-op.

Reimplemented in vtkWrite, externalCoupled, ensightWrite, DMD, interfaceHeight, codedFunctionObject, timeControl, systemCall, abort, and parProfiling.

Definition at line 192 of file functionObject.C.

Referenced by nearWallFields::calcAddressing(), and externalCoupled::end().

Here is the caller graph for this function:

◆ adjustTimeStep()

bool adjustTimeStep ( )
virtual

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

Reimplemented in timeControl, setTimeStepFunctionObject, and setTimeStepFaRegionsFunctionObject.

Definition at line 198 of file functionObject.C.

◆ filesModified()

bool filesModified ( ) const
virtual

Did any file get changed during execution?

Reimplemented in timeControl, and timeActivatedFileUpdate.

Definition at line 204 of file functionObject.C.

◆ updateMesh()

void updateMesh ( const mapPolyMesh mpm)
virtual

Update for changes of mesh.

The base implementation is a no-op.

Reimplemented in surfaceFieldValue, sampledSurfaces, vtkWrite, ObukhovLength, ensightWrite, areaWrite, timeControl, derivedFields, momentum, probes, sampledSets, and streamLineBase.

Definition at line 210 of file functionObject.C.

◆ movePoints()

void movePoints ( const polyMesh mesh)
virtual

Update for changes of mesh.

The base implementation is a no-op.

Reimplemented in ensightWrite, surfaceFieldValue, propellerInfo, sampledSurfaces, vtkWrite, areaWrite, timeControl, ObukhovLength, derivedFields, momentum, probes, sampledSets, and streamLineBase.

Definition at line 214 of file functionObject.C.

Member Data Documentation

◆ log

bool log

Flag to write log into Info.

Definition at line 355 of file functionObject.H.

◆ debug

int debug
static

Flag to execute debug content.

Definition at line 367 of file functionObject.H.

Referenced by nearWallFields::calcAddressing(), patchProbes::findElements(), probes::findElements(), and syncObjects::sync().

◆ postProcess

bool postProcess
static

Global post-processing mode switch.

Definition at line 370 of file functionObject.H.

◆ defaultUseNamePrefix

bool defaultUseNamePrefix
static

Global default for useNamePrefix.

Definition at line 373 of file functionObject.H.

Referenced by functionObjectList::read().

◆ outputPrefix


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