solverControl Class Reference

Base class for solver control classes. More...

Inheritance diagram for solverControl:
Collaboration diagram for solverControl:

Public Member Functions

 TypeName ("solverControl")
 Run-time type information. More...
 
 solverControl (const solver &solver)
 Construct from solver. More...
 
virtual ~solverControl ()=default
 Destructor. More...
 
virtual const dictionary solverDict () const
 Read controls from optimisationDict. More...
 
virtual const dictionary solutionDict () const
 Return the solutionControls dictionary. More...
 
bool printMaxMags () const
 Print max mags of solver fields. More...
 
bool storeInitValues () const
 Re-initialize. More...
 
label iter () const
 Return iteration index. More...
 
label & averageIter ()
 Return average iteration index reference. More...
 
label averageIter () const
 Return const average iteration index reference. More...
 
label averageStartIter () const
 Return iteration index. More...
 
bool doAverageIter () const
 Whether or not to add fields of the current iteration to the average fields. More...
 
bool useAveragedFields () const
 Use averaged fields? For solving the adjoint equations or computing sensitivities based on averaged fields. More...
 
bool average () const
 Whether averaging is enabled or not. More...
 
const solvergetSolver () const
 Return reference to the underlaying solver. More...
 

Protected Member Functions

virtual bool read ()
 Read controls from optimisationDict. More...
 

Protected Attributes

const solversolver_
 Reference to the underlaying solver. More...
 
bool printMaxMags_
 Whether to print the max magnitude during each solver iteration. More...
 
label iter_
 Current iteration index. More...
 
label averageIter_
 Current averaging iteration index. More...
 
label averageStartIter_
 Averaging start index. More...
 
bool storeInitValues_
 Whether to re-initialize the solution based on the initial time step. Makes sense only for optimisation or FD runs. More...
 
bool average_
 Do averaging. More...
 

Detailed Description

Base class for solver control classes.

Definition at line 45 of file solverControl.H.

Constructor & Destructor Documentation

◆ solverControl()

solverControl ( const solver solver)

Construct from solver.

Definition at line 49 of file solverControl.C.

References solverControl::read().

Here is the call graph for this function:

◆ ~solverControl()

virtual ~solverControl ( )
virtualdefault

Destructor.

Member Function Documentation

◆ read()

bool read ( )
protectedvirtual

Read controls from optimisationDict.

Reimplemented in SIMPLEControl, SIMPLEControlOpt, and SIMPLEControlSingleRun.

Definition at line 34 of file solverControl.C.

References solverControl::averageStartIter_, dictionary::getOrDefault(), solverControl::printMaxMags_, solverControl::solutionDict(), and dictionary::subOrEmptyDict().

Referenced by SIMPLEControl::read(), and solverControl::solverControl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TypeName()

TypeName ( "solverControl"  )

Run-time type information.

◆ solverDict()

const Foam::dictionary solverDict ( ) const
inlinevirtual

Read controls from optimisationDict.

Return the solver dictionary

Definition at line 26 of file solverControlI.H.

References solver::dict(), and solverControl::solver_.

Here is the call graph for this function:

◆ solutionDict()

const Foam::dictionary solutionDict ( ) const
inlinevirtual

Return the solutionControls dictionary.

Definition at line 32 of file solverControlI.H.

References dictionary::subDict().

Referenced by SIMPLEControl::dict(), and solverControl::read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ printMaxMags()

bool printMaxMags ( ) const
inline

Print max mags of solver fields.

Definition at line 38 of file solverControlI.H.

Referenced by adjointSpalartAllmaras::correct(), and adjointkOmegaSST::correct().

Here is the caller graph for this function:

◆ storeInitValues()

◆ iter()

Foam::label iter ( ) const
inline

Return iteration index.

Definition at line 50 of file solverControlI.H.

◆ averageIter() [1/2]

◆ averageIter() [2/2]

Foam::label averageIter ( ) const
inline

Return const average iteration index reference.

Definition at line 62 of file solverControlI.H.

◆ averageStartIter()

Foam::label averageStartIter ( ) const
inline

Return iteration index.

Definition at line 68 of file solverControlI.H.

◆ doAverageIter()

bool doAverageIter ( ) const
inline

Whether or not to add fields of the current iteration to the average fields.

Definition at line 74 of file solverControlI.H.

Referenced by objective::accumulateJMean(), kEpsilon::computeMeanFields(), kOmegaSST::computeMeanFields(), incompressibleAdjointVars::computeMeanFields(), RASModelVariables::computeMeanFields(), incompressibleVars::computeMeanFields(), and adjointRASModel::computeMeanFields().

Here is the caller graph for this function:

◆ useAveragedFields()

bool useAveragedFields ( ) const
inline

◆ average()

◆ getSolver()

const Foam::solver & getSolver ( ) const
inline

Return reference to the underlaying solver.

Definition at line 106 of file solverControlI.H.

Member Data Documentation

◆ solver_

const solver& solver_
protected

Reference to the underlaying solver.

Definition at line 54 of file solverControl.H.

Referenced by SIMPLEControl::read(), and solverControl::solverDict().

◆ printMaxMags_

bool printMaxMags_
protected

Whether to print the max magnitude during each solver iteration.

Useful for adjoint solvers

Definition at line 63 of file solverControl.H.

Referenced by solverControl::read().

◆ iter_

label iter_
protected

Current iteration index.

Definition at line 71 of file solverControl.H.

◆ averageIter_

label averageIter_
protected

Current averaging iteration index.

Definition at line 76 of file solverControl.H.

◆ averageStartIter_

label averageStartIter_
protected

Averaging start index.

Definition at line 81 of file solverControl.H.

Referenced by solverControl::read(), and SIMPLEControl::read().

◆ storeInitValues_

bool storeInitValues_
protected

Whether to re-initialize the solution based on the initial time step. Makes sense only for optimisation or FD runs.

Definition at line 89 of file solverControl.H.

◆ average_

bool average_
protected

Do averaging.

Definition at line 94 of file solverControl.H.

Referenced by SIMPLEControl::read().


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