Public Member Functions | Private Member Functions | Private Attributes
setTimeStepFunctionObject Class Reference

This function object overrides the calculation time step. Can only be used with solvers with adjustTimeStep control (e.g. pimpleFoam). It makes no attempt to co-operate with other time step 'controllers', e.g. maxCo, other functionObjects. Supports 'enabled' flag but none of the other options 'timeStart', 'timeEnd', 'outputControl' etc. More...

Inheritance diagram for setTimeStepFunctionObject:
Inheritance graph
[legend]
Collaboration diagram for setTimeStepFunctionObject:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("setTimeStep")
 Runtime type information. More...
 
 setTimeStepFunctionObject (const word &name, const Time &runTime, const dictionary &dict)
 Construct from components. More...
 
virtual const Timetime () const
 Return time database. More...
 
virtual bool enabled () const
 Return the enabled flag. 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

 setTimeStepFunctionObject (const setTimeStepFunctionObject &)
 Disallow default bitwise copy construct. More...
 
void operator= (const setTimeStepFunctionObject &)
 Disallow default bitwise assignment. More...
 

Private Attributes

const Timetime_
 Reference to the time database. More...
 
Switch enabled_
 Switch for the execution - defaults to 'yes/on'. More...
 
autoPtr< DataEntry< scalar > > timeStepPtr_
 Time step. 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

This function object overrides the calculation time step. Can only be used with solvers with adjustTimeStep control (e.g. pimpleFoam). It makes no attempt to co-operate with other time step 'controllers', e.g. maxCo, other functionObjects. Supports 'enabled' flag but none of the other options 'timeStart', 'timeEnd', 'outputControl' etc.

Example of function object specification to manipulate the time step:

setTimeStep1
{
    type        setTimeStep;
    functionObjectLibs ("libutilityFunctionObjects.so");
    ...
}


Function object usage

Property Description Required Default value
type Type name: setTimeStep yes
enabled On/off switch no yes
Source files

Definition at line 91 of file setTimeStepFunctionObject.H.

Constructor & Destructor Documentation

◆ setTimeStepFunctionObject() [1/2]

Disallow default bitwise copy construct.

◆ setTimeStepFunctionObject() [2/2]

setTimeStepFunctionObject ( const word name,
const Time runTime,
const dictionary dict 
)

Construct from components.

Definition at line 47 of file setTimeStepFunctionObject.C.

References dict, and Foam::read().

Here is the call graph for this function:

Member Function Documentation

◆ operator=()

void operator= ( const setTimeStepFunctionObject )
private

Disallow default bitwise assignment.

◆ TypeName()

TypeName ( "setTimeStep"  )

Runtime type information.

◆ time()

virtual const Time& time ( ) const
inlinevirtual

Return time database.

Definition at line 138 of file setTimeStepFunctionObject.H.

References setTimeStepFunctionObject::time_.

◆ enabled()

virtual bool enabled ( ) const
inlinevirtual

Return the enabled flag.

Definition at line 144 of file setTimeStepFunctionObject.H.

References setTimeStepFunctionObject::enabled_.

◆ on()

void on ( )
virtual

Switch the function object on.

Definition at line 63 of file setTimeStepFunctionObject.C.

References setTimeStepFunctionObject::enabled_.

◆ off()

void off ( )
virtual

Switch the function object off.

Definition at line 69 of file setTimeStepFunctionObject.C.

◆ start()

bool start ( )
virtual

Called at the start of the time-loop.

Implements functionObject.

Definition at line 75 of file setTimeStepFunctionObject.C.

◆ execute()

bool execute ( const bool  forceWrite)
virtual

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

Implements functionObject.

Definition at line 81 of file setTimeStepFunctionObject.C.

◆ end()

bool end ( )
virtual

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

Reimplemented from functionObject.

Definition at line 87 of file setTimeStepFunctionObject.C.

◆ timeSet()

bool timeSet ( )
virtual

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

Reimplemented from functionObject.

Definition at line 93 of file setTimeStepFunctionObject.C.

◆ adjustTimeStep()

bool adjustTimeStep ( )
virtual

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

Reimplemented from functionObject.

Definition at line 99 of file setTimeStepFunctionObject.C.

◆ read()

bool read ( const dictionary dict)
virtual

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

Implements functionObject.

Definition at line 117 of file setTimeStepFunctionObject.C.

References controlDict(), dict, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, and DataEntry::New().

Here is the call graph for this function:

◆ updateMesh()

void updateMesh ( const mapPolyMesh mpm)
virtual

Update for changes of mesh.

Implements functionObject.

Definition at line 144 of file setTimeStepFunctionObject.C.

◆ movePoints()

void movePoints ( const polyMesh mesh)
virtual

Update for changes of mesh.

Implements functionObject.

Definition at line 148 of file setTimeStepFunctionObject.C.

Field Documentation

◆ time_

const Time& time_
private

Reference to the time database.

Definition at line 98 of file setTimeStepFunctionObject.H.

Referenced by setTimeStepFunctionObject::time().

◆ enabled_

Switch enabled_
private

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

Definition at line 104 of file setTimeStepFunctionObject.H.

Referenced by setTimeStepFunctionObject::enabled(), and setTimeStepFunctionObject::on().

◆ timeStepPtr_

autoPtr<DataEntry<scalar> > timeStepPtr_
private

Time step.

Definition at line 107 of file setTimeStepFunctionObject.H.


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