regionSolvers Class Reference

Class to hold the lists of region meshes and solvers. More...

Classes

class  iterator
 

Public Member Functions

 regionSolvers (const Time &runTime)
 Construct from components. More...
 
 regionSolvers (const regionSolvers &)=delete
 Disallow default bitwise copy construction. More...
 
 ~regionSolvers ()
 Destructor. More...
 
label size () const
 Return the number of region solvers. More...
 
void setGlobalPrefix () const
 Set the Info prefix to space padding for global messages. More...
 
void setPrefix (const label i) const
 Set the Info prefix to the space padded region name. More...
 
void resetPrefix () const
 Reset the Info prefix to null. More...
 
iterator begin ()
 Return an iterator to begin traversing the solvers. More...
 
iterator end ()
 Return an iterator to end traversing the solvers. More...
 
 operator PtrList< solver > & ()
 Cast to the list of solvers. More...
 
solveroperator[] (const label i)
 Set the region i prefix and return the corresponding solver. More...
 
void operator= (const regionSolvers &)=delete
 Disallow default bitwise assignment. More...
 

Friends

class iterator
 

Detailed Description

Class to hold the lists of region meshes and solvers.

Also provides loop and iteration functionality which automatically set the region Info prefix for each of the solvers returned by the '[]' operator or iterator.

Usage
Given the regionSolvers named solvers:
    // Create the region meshes and solvers
    regionSolvers solvers(runTime);

The list of solvers can be looped over:

    forAll(solvers, i)
    {
        solvers[i].momentumPredictor();
    }

where the '[]' operator sets the region Info prefix. After the loop the region Info prefix remains set to the last region prefix and so for global messages, e.g. the global time-step the Info prefix must be specifically reset to spaces by calling the setGlobalPrefix() function.

Alternatively the list of solvers can be iterated over:

    forAllIter(regionSolvers, solvers, solver)
    {
        solver->momentumPredictor();
    }

where the iterator increment sets the region Info prefix and at the end automatically resets the Info prefix to spaces.

Source files

Definition at line 81 of file regionSolvers.H.

Constructor & Destructor Documentation

◆ regionSolvers() [1/2]

regionSolvers ( const Time runTime)

Construct from components.

◆ regionSolvers() [2/2]

regionSolvers ( const regionSolvers )
delete

Disallow default bitwise copy construction.

◆ ~regionSolvers()

Destructor.

Member Function Documentation

◆ size()

Foam::label size ( ) const
inline

Return the number of region solvers.

Definition at line 28 of file regionSolversI.H.

◆ setGlobalPrefix()

void setGlobalPrefix ( ) const

Set the Info prefix to space padding for global messages.

◆ setPrefix()

void setPrefix ( const label  i) const

Set the Info prefix to the space padded region name.

Referenced by regionSolvers::begin().

Here is the caller graph for this function:

◆ resetPrefix()

void resetPrefix ( ) const

Reset the Info prefix to null.

◆ begin()

Return an iterator to begin traversing the solvers.

Definition at line 109 of file regionSolversI.H.

References regionSolvers::iterator, and regionSolvers::setPrefix().

Here is the call graph for this function:

◆ end()

Return an iterator to end traversing the solvers.

Definition at line 119 of file regionSolversI.H.

◆ operator PtrList< solver > &()

operator PtrList< solver > & ( )
inline

Cast to the list of solvers.

Definition at line 132 of file regionSolversI.H.

◆ operator[]()

solver& operator[] ( const label  i)

Set the region i prefix and return the corresponding solver.

◆ operator=()

void operator= ( const regionSolvers )
delete

Disallow default bitwise assignment.

Friends And Related Function Documentation

◆ iterator

friend class iterator
friend

Definition at line 131 of file regionSolvers.H.

Referenced by regionSolvers::begin().


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