Public Member Functions | Protected Attributes | List of all members
loopControl Class Reference

A class for managing arbitrary loops with the ability to invoke function object execution. More...

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

Public Member Functions

 loopControl (Time &runTime, const label nCycles, const word &dictName="loop")
 
 loopControl (Time &runTime, const word &algorithmName, const word &dictName="loop")
 
 loopControl (Time &runTime, const dictionary &algorithmDict, const word &dictName="loop")
 
 ~loopControl ()
 
const wordname () const
 
label interval () const
 
bool loop ()
 
- Public Member Functions inherited from subLoopTime
 subLoopTime (Time &runTime, const label nCycles)
 
 ~subLoopTime ()
 
label index () const
 
label nCycles () const
 
bool status () const
 
void stop ()
 
bool loop ()
 
subLoopTimeoperator++ ()
 

Protected Attributes

word name_
 
label interval_
 
dictionary convergenceDict_
 
wordRes onLoop_
 
wordRes onConverged_
 
wordRes onEnd_
 
bool converged_
 
- Protected Attributes inherited from subLoopTime
Timetime_
 
label index_
 
label total_
 

Detailed Description

A class for managing arbitrary loops with the ability to invoke function object execution.

Usage
Examples of function object specification:
SIMPLE
{
    energyCoupling
    {
        iterations  100;
        onLoop      ();
        onConverged ( externalCoupled  "loopThings.*" );

        convergence
        {
            "h"     1e-3;
        }
    }
}

Where the loop entries comprise:

Property Description Required Default
enabled activate/deactivate loop no true
iteration times to loop no 0
timeStart begin time for loop activation no -VGREAT
timeEnd end time of loop activation no VGREAT
interval sub-interval to execute onLoop no 0
onLoop function object names to call at executeInterval no
onConverged function object names to call when converged no
onEnd function object names to call when loop ends no
convergence dictionary of convergence values to check no

The function object names listed by onLoop, onConverged, onEnd must implement an execute(int) method. If the time controls timeStart or timeEnd are used for the loop, these values are only inspected upon creation, not during execution.

See also
fvSolution
Source files

Definition at line 136 of file loopControl.H.

Constructor & Destructor Documentation

◆ loopControl() [1/3]

loopControl ( Time runTime,
const label  nCycles,
const word dictName = "loop" 
)

Definition at line 138 of file loopControl.C.

◆ loopControl() [2/3]

loopControl ( Time runTime,
const word algorithmName,
const word dictName = "loop" 
)

Definition at line 176 of file loopControl.C.

References dictName(), dictionary::findDict(), Foam::read(), and solution::solutionDict().

Here is the call graph for this function:

◆ loopControl() [3/3]

loopControl ( Time runTime,
const dictionary algorithmDict,
const word dictName = "loop" 
)

Definition at line 156 of file loopControl.C.

References dictName(), dictionary::findDict(), and Foam::read().

Here is the call graph for this function:

◆ ~loopControl()

Definition at line 205 of file loopControl.C.

Member Function Documentation

◆ name()

const word& name ( ) const
inline

Definition at line 233 of file loopControl.H.

References loopControl::name_.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

◆ interval()

label interval ( ) const
inline

Definition at line 239 of file loopControl.H.

References loopControl::interval_.

◆ loop()

bool loop ( )

Definition at line 213 of file loopControl.C.

Member Data Documentation

◆ name_

word name_
protected

Definition at line 163 of file loopControl.H.

Referenced by loopControl::name().

◆ interval_

label interval_
protected

Definition at line 166 of file loopControl.H.

Referenced by loopControl::interval().

◆ convergenceDict_

dictionary convergenceDict_
protected

Definition at line 169 of file loopControl.H.

◆ onLoop_

wordRes onLoop_
protected

Definition at line 172 of file loopControl.H.

◆ onConverged_

wordRes onConverged_
protected

Definition at line 175 of file loopControl.H.

◆ onEnd_

wordRes onEnd_
protected

Definition at line 179 of file loopControl.H.

◆ converged_

bool converged_
protected

Definition at line 182 of file loopControl.H.


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