mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: adding hook adjustTimeStep to function objects. The hook is called in
Time::adjustDeltaT(). It allows function objects to manipulate the time step to
dump at adjustable times. The following options are available for output in
function objects: timeStep, outputTime, adjustableTime, runTime, clockTime
and cpuTime.
This commit is contained in:
@ -211,6 +211,27 @@ bool Foam::functionObjectList::timeSet()
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjectList::adjustTimeStep()
|
||||
{
|
||||
bool ok = true;
|
||||
|
||||
if (execution_)
|
||||
{
|
||||
if (!updated_)
|
||||
{
|
||||
read();
|
||||
}
|
||||
|
||||
forAll(*this, objectI)
|
||||
{
|
||||
ok = operator[](objectI).adjustTimeStep() && ok;
|
||||
}
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjectList::read()
|
||||
{
|
||||
bool ok = true;
|
||||
|
||||
@ -166,6 +166,9 @@ public:
|
||||
//- Called when time was set at the end of the Time::operator++
|
||||
virtual bool timeSet();
|
||||
|
||||
//- Called at the end of Time::adjustDeltaT() if adjustTime is true
|
||||
virtual bool adjustTimeStep();
|
||||
|
||||
//- Read and set the function objects if their data have changed
|
||||
virtual bool read();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user