functionObject Class Referenceabstract

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

Inheritance diagram for functionObject:
Collaboration diagram for functionObject:

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 329 of file functionObject.H.

Constructor & Destructor Documentation

◆ functionObject()

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

Construct from components.

Definition at line 58 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 44 of file functionObject.C.

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

Referenced by forces::force().

Here is the call graph for this function:
Here is the caller 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 419 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 72 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 multiRegion::read(), functionObjectList::read(), and codedFunctionObject::redirectFunctionObject().

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

◆ type()

◆ name()

◆ useNamePrefix() [1/2]

bool useNamePrefix ( ) const
noexcept

Return the flag for adding a scoping name prefix.

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

Definition at line 156 of file functionObject.C.

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

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

Definition at line 185 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 191 of file functionObject.C.

◆ filesModified()

bool filesModified ( ) const
virtual

Did any file get changed during execution?

Reimplemented in timeControl, and timeActivatedFileUpdate.

Definition at line 197 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, vtkWrite, sampledSurfaces, sampledSets, ensightWrite, probes, momentum, ObukhovLength, streamLineBase, timeControl, binField, areaWrite, derivedFields, and processorField.

Definition at line 203 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 surfaceFieldValue, propellerInfo, vtkWrite, sampledSurfaces, sampledSets, ensightWrite, probes, momentum, ObukhovLength, streamLineBase, timeControl, binField, areaWrite, and derivedFields.

Definition at line 207 of file functionObject.C.

Member Data Documentation

◆ log

bool log

Flag to write log into Info.

Definition at line 359 of file functionObject.H.

◆ debug

int debug
static

Flag to execute debug content.

Definition at line 375 of file functionObject.H.

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

◆ postProcess

bool postProcess
static

Global post-processing mode switch.

Definition at line 380 of file functionObject.H.

Referenced by readFields::execute().

◆ defaultUseNamePrefix

bool defaultUseNamePrefix
static

Global default for useNamePrefix.

Definition at line 385 of file functionObject.H.

Referenced by functionObjectList::read().

◆ outputPrefix


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