Loading...
Searching...
No Matches
functionObject Class Referenceabstract

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

#include <functionObject.H>

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.
autoPtr< functionObjectclone () const
 Return clone.
virtual ~functionObject ()=default
 Destructor.
virtual const wordtype () const =0
 Runtime type information.
const wordname () const noexcept
 Return the name of this functionObject.
bool useNamePrefix () const noexcept
 Return the flag for adding a scoping name prefix.
bool useNamePrefix (bool on) noexcept
 Modify the flag for adding a scoping name prefix.
virtual bool read (const dictionary &dict)
 Read and set the function object if its data have changed.
virtual bool execute ()=0
 Called at each ++ or += of the time-loop.
virtual bool execute (const label subIndex)
 Execute using the specified subIndex.
virtual bool write ()=0
 Called at each ++ or += of the time-loop.
virtual bool end ()
 Called when Time::run() determines that the time-loop exits.
virtual bool adjustTimeStep ()
 Called at the end of Time::adjustDeltaT() if adjustTime is true.
virtual bool filesModified () const
 Did any file get changed during execution?
virtual void updateMesh (const mapPolyMesh &mpm)
 Update for changes of mesh.
virtual void movePoints (const polyMesh &mesh)
 Update for changes of mesh.

Static Public Member Functions

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

Public Attributes

bool log
 Flag to write log into Info.

Static Public Attributes

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

Protected Member Functions

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

Detailed Description

Abstract base-class for Time/database function objects.

See also
Source files

Definition at line 363 of file functionObject.H.

Constructor & Destructor Documentation

◆ functionObject()

◆ ~functionObject()

virtual ~functionObject ( )
virtualdefault

Destructor.

Member Function Documentation

◆ scopedName()

◆ declareRunTimeSelectionTable()

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

References defaultUseNamePrefix, dict, functionObject(), name(), and runTime.

Here is the call graph for this function:

◆ clone()

autoPtr< functionObject > clone ( ) const
inline

Return clone.

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

References DebugInfo, dict, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, FatalErrorInLookup, name(), Foam::nl, and runTime.

Referenced by functionObjectList::read(), multiFieldValue::read(), multiRegion::read(), codedFunctionObject::redirectFunctionObject(), and timeControl::timeControl().

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

◆ type()

virtual const word & type ( ) const
pure virtual

◆ name()

const Foam::word & name ( ) const
noexcept

Return the name of this functionObject.

Definition at line 136 of file functionObject.C.

References Foam::noexcept.

Referenced by abort::abort(), extractEulerianParticles::checkFaceZone(), cloudInfo::cloudInfo(), codedFunctionObject::codedFunctionObject(), declareRunTimeSelectionTable(), externalCoupled::externalCoupled(), filmFlux::filmFlux(), foamReport::foamReport(), fieldExpression::foundObject(), functionObject(), fvMeshFunctionObject::fvMeshFunctionObject(), fvMeshFunctionObject::fvMeshFunctionObject(), graphFunctionObject::graphFunctionObject(), sizeDistribution::initialise(), fieldAverage::initialize(), multiFieldValue::multiFieldValue(), multiRegion::multiRegion(), New(), stateFunctionObject::operator=(), timeFunctionObject::operator=(), parProfiling::parProfiling(), pointHistory::pointHistory(), regionFunctionObject::regionFunctionObject(), regionFunctionObject::regionFunctionObject(), removeRegisteredObject::removeRegisteredObject(), runTimeControl::runTimeControl(), scopedName(), setTimeStepFaRegionsFunctionObject::setTimeStepFaRegionsFunctionObject(), setTimeStepFunctionObject::setTimeStepFunctionObject(), stateFunctionObject::stateFunctionObject(), syncObjects::syncObjects(), systemCall::systemCall(), timeActivatedFileUpdate::timeActivatedFileUpdate(), timeControl::timeControl(), timeFunctionObject::timeFunctionObject(), timeInfo::timeInfo(), abort::TypeName(), cloudInfo::TypeName(), codedFunctionObject::TypeName(), multiFieldValue::TypeName(), volFieldValue::TypeName(), filmFlux::TypeName(), foamReport::TypeName(), fvMeshFunctionObject::TypeName(), graphFunctionObject::TypeName(), multiRegion::TypeName(), parProfiling::TypeName(), regionFunctionObject::TypeName(), removeRegisteredObject::TypeName(), runTimeControl::TypeName(), setTimeStepFaRegionsFunctionObject::TypeName(), setTimeStepFunctionObject::TypeName(), syncObjects::TypeName(), systemCall::TypeName(), timeActivatedFileUpdate::TypeName(), timeControl::TypeName(), timeInfo::TypeName(), valueAverage::TypeName(), writeDictionary::TypeName(), writeObjects::TypeName(), pointHistory::TypeName(), functionObject::unavailableFunctionObject::unavailableFunctionObject(), valueAverage::valueAverage(), volFieldValue::volFieldValue(), volFieldValue::volFieldValue(), vtkWrite::vtkWrite(), caseInfo::write(), writeDictionary::writeDictionary(), writeFreeSurface::writeFreeSurface(), and writeObjects::writeObjects().

◆ useNamePrefix() [1/2]

bool useNamePrefix ( ) const
noexcept

Return the flag for adding a scoping name prefix.

Definition at line 142 of file functionObject.C.

References Foam::noexcept.

Referenced by type().

Here is the caller graph for this function:

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

Definition at line 156 of file functionObject.C.

References defaultUseNamePrefix, dict, keyType::LITERAL, log, and postProcess.

Referenced by abort::read(), age::read(), AMIWeights::read(), BilgerMixtureFraction::read(), binField::read(), caseInfo::read(), cellDecomposer::read(), codedFunctionObject::read(), columnAverage::read(), comfort::read(), continuityError::read(), Curle::read(), dataCloud::read(), ddt2::read(), derivedFields::read(), DESModelRegions::read(), DMD::read(), dsmcFields::read(), electricPotential::read(), energySpectrum::read(), energyTransport::read(), externalCoupled::read(), extractEulerianParticles::read(), fieldAverage::read(), fieldExpression::read(), fieldExtents::read(), fieldMinMax::read(), fieldsExpression::read(), fieldValue::read(), multiFieldValue::read(), filmFlux::read(), fluxSummary::read(), foamReport::read(), forces::read(), fvExpressionField::read(), histogram::read(), hydrostaticPressure::read(), icoUncoupledKinematicCloud::read(), limitFields::read(), log::read(), mapFields::read(), momentum::read(), momentumError::read(), multiRegion::read(), nearWallFields::read(), ObukhovLength::read(), particleDistribution::read(), pow::read(), processorField::read(), proudmanAcousticPower::read(), reactionsSensitivityAnalysis< chemistryType >::read(), readFields::read(), regionFunctionObject::read(), regionSizeDistribution::read(), resolutionIndex::read(), runTimeControl::read(), scalarTransport::read(), setFlow::read(), setTimeStepFaRegionsFunctionObject::read(), setTimeStepFunctionObject::read(), sixDoFRigidBodyState::read(), sizeDistribution::read(), solverInfo::read(), streamLineBase::read(), surfaceCourantNumber::read(), surfaceDistance::read(), surfaceInterpolate::read(), syncObjects::read(), systemCall::read(), timeActivatedFileUpdate::read(), timeInfo::read(), turbulenceFields::read(), viewFactorHeatFlux::read(), wallShearStress::read(), writeCellCentres::read(), writeCellVolumes::read(), writeObjects::read(), XiReactionRate::read(), yPlus::read(), zeroGradient::read(), moleFractions< ThermoType >::read(), and type().

◆ 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 areaWrite, functionObject::unavailableFunctionObject, abort, age, AMIWeights, BilgerMixtureFraction, binField, bladeForces, caseInfo, cellDecomposer, cloudInfo, codedFunctionObject, columnAverage, comfort, continuityError, Curle, dataCloud, ddt2, derivedFields, DESModelRegions, DMD, dsmcFields, electricPotential, energySpectrum, energyTransport, ensightCloudWriteObject, ensightWrite, externalCoupled, extractEulerianParticles, fieldAverage, fieldExpression, fieldExtents, fieldMinMax, fieldsExpression, fieldStatistics, fieldValue, multiFieldValue, filmFlux, fluxSummary, foamReport, forceCoeffs, forces, fvExpressionField, graphFunctionObject, histogram, hydrostaticPressure, icoUncoupledKinematicCloud, interfaceHeight, limitFields, mapFields, momentum, momentumError, multiRegion, nearWallFields, ObukhovLength, parProfiling, particleDistribution, processorField, propellerInfo, proudmanAcousticPower, radiometerProbes, reactionsSensitivityAnalysis< chemistryType >, reactionsSensitivityAnalysis< BasicChemistryModel< psiReactionThermo > >, reactionsSensitivityAnalysis< BasicChemistryModel< rhoReactionThermo > >, readFields, regionSizeDistribution, removeRegisteredObject, resolutionIndex, runTimeControl, scalarTransport, setFlow, setTimeStepFaRegionsFunctionObject, setTimeStepFunctionObject, sixDoFRigidBodyState, sizeDistribution, solverInfo, specieReactionRates< ChemistryModelType >, specieReactionRates< BasicChemistryModel< psiReactionThermo > >, specieReactionRates< BasicChemistryModel< rhoReactionThermo > >, streamLineBase, surfaceCourantNumber, surfaceDistance, surfaceInterpolate, syncObjects, systemCall, thermoCoupleProbes, timeActivatedFileUpdate, timeControl, timeInfo, turbulenceFields, valueAverage, viewFactorHeatFlux, vtkCloud, vtkWrite, wallHeatFlux, wallShearStress, writeCellCentres, writeCellVolumes, writeDictionary, writeFreeSurface, writeObjects, XiReactionRate, yPlus, zeroGradient, moleFractions< ThermoType >, moleFractions< psiReactionThermo >, moleFractions< rhoReactionThermo >, pointHistory, Probes< ProbeType >, Probes< internalFieldProbe >, Probes< patchFieldProbe >, sampledSets, and sampledSurfaces.

References execute().

Referenced by execute().

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

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

References adjustTimeStep(), end(), filesModified(), mesh, movePoints(), updateMesh(), and write().

Referenced by write().

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

◆ end()

bool end ( )
virtual

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

The base implementation is a no-op.

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

Definition at line 185 of file functionObject.C.

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

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 setTimeStepFaRegionsFunctionObject, setTimeStepFunctionObject, and timeControl.

Definition at line 191 of file functionObject.C.

Referenced by write().

Here is the caller graph for this function:

◆ filesModified()

bool filesModified ( ) const
virtual

Did any file get changed during execution?

Reimplemented in timeActivatedFileUpdate, and timeControl.

Definition at line 197 of file functionObject.C.

Referenced by write().

Here is the caller graph for this function:

◆ updateMesh()

void updateMesh ( const mapPolyMesh & mpm)
virtual

Update for changes of mesh.

The base implementation is a no-op.

Reimplemented in areaWrite, binField, derivedFields, ensightWrite, momentum, ObukhovLength, processorField, streamLineBase, timeControl, viewFactorHeatFlux, vtkWrite, sampledSets, and sampledSurfaces.

Definition at line 203 of file functionObject.C.

Referenced by write().

Here is the caller graph for this function:

◆ movePoints()

void movePoints ( const polyMesh & mesh)
virtual

Update for changes of mesh.

The base implementation is a no-op.

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

Definition at line 207 of file functionObject.C.

Referenced by write().

Here is the caller graph for this function:

Member Data Documentation

◆ log

bool log

Flag to write log into Info.

Definition at line 401 of file functionObject.H.

Referenced by functionObject(), and read().

◆ debug

int debug
static

Flag to execute debug content.

Definition at line 409 of file functionObject.H.

Referenced by timeControl::adjustTimeStep(), syncObjects::execute(), syncObjects::read(), syncObjects::sync(), and syncObjects::write().

◆ postProcess

bool postProcess
static

◆ defaultUseNamePrefix

bool defaultUseNamePrefix
static

Global default for useNamePrefix.

Definition at line 419 of file functionObject.H.

Referenced by declareRunTimeSelectionTable(), read(), and functionObjectList::read().

◆ outputPrefix


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