subLoopTime Class Reference

A class for managing sub-loops referencing Time. More...

Inheritance diagram for subLoopTime:
[legend]
Collaboration diagram for subLoopTime:
[legend]

Public Member Functions

 subLoopTime (Time &runTime, const label nCycles)
 Construct from time with fixed number of cycles. More...
 
 ~subLoopTime ()
 Destructor. More...
 
label index () const
 The current cycle index. More...
 
label nCycles () const
 The total number of cycles. More...
 
bool status () const
 Return true if looping is active. More...
 
void stop ()
 Force terminate the loop. More...
 
bool loop ()
 True if looping is active, increments the index. More...
 
subLoopTimeoperator++ ()
 Prefix increment. More...
 

Protected Attributes

Timetime_
 
label index_
 The current sub-cycle index. More...
 
label total_
 The total number of cycles in the sub-cycle. More...
 

Detailed Description

A class for managing sub-loops referencing Time.

Source files
See also
subCycleTime

Definition at line 53 of file subLoopTime.H.

Constructor & Destructor Documentation

◆ subLoopTime()

subLoopTime ( Time runTime,
const label  nCycles 
)

Construct from time with fixed number of cycles.

Parameters
runTimethe top-level time
nCyclesthe number of times to loop

Definition at line 32 of file subLoopTime.C.

◆ ~subLoopTime()

Destructor.

Definition at line 42 of file subLoopTime.C.

Member Function Documentation

◆ index()

label index ( ) const
inline

The current cycle index.

Definition at line 94 of file subLoopTime.H.

References subLoopTime::index_.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

◆ nCycles()

label nCycles ( ) const
inline

The total number of cycles.

Definition at line 100 of file subLoopTime.H.

References subLoopTime::total_.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

◆ status()

bool status ( ) const

Return true if looping is active.

Definition at line 50 of file subLoopTime.C.

◆ stop()

void stop ( )

Force terminate the loop.

Definition at line 56 of file subLoopTime.C.

◆ loop()

bool loop ( )

True if looping is active, increments the index.

Example usage,

while (control.loop())
{
}
CEqn solve()

Definition at line 63 of file subLoopTime.C.

◆ operator++()

Foam::subLoopTime & operator++ ( )

Prefix increment.

Definition at line 80 of file subLoopTime.C.

Member Data Documentation

◆ time_

Time& time_
protected

Definition at line 68 of file subLoopTime.H.

Referenced by loopControl::loopControl().

◆ index_

label index_
protected

The current sub-cycle index.

Definition at line 71 of file subLoopTime.H.

Referenced by subLoopTime::index().

◆ total_

label total_
protected

The total number of cycles in the sub-cycle.

Definition at line 74 of file subLoopTime.H.

Referenced by subLoopTime::nCycles().


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