solverControl Class Reference

Base class for solver control classes. More...

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

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
 
bool useAveragedFields () const
 
bool average () const
 Whether averaging is enabled or not. 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_
 
bool average_
 Do averaging. More...
 

Detailed Description

Base class for solver control classes.

Definition at line 51 of file solverControl.H.

Constructor & Destructor Documentation

◆ solverControl()

solverControl ( const solver solver)

Construct from solver.

Definition at line 56 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 41 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 33 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 39 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 45 of file solverControlI.H.

Referenced by adjointSpalartAllmaras::correct().

Here is the caller graph for this function:

◆ storeInitValues()

bool storeInitValues ( ) const
inline

Re-initialize.

Definition at line 51 of file solverControlI.H.

Referenced by RASModelVariables::allocateInitValues(), RASModelVariables::restoreInitValues(), incompressibleVars::restoreInitValues(), incompressibleVars::setInitFields(), and incompressibleVars::storeInitValues().

Here is the caller graph for this function:

◆ iter()

Foam::label iter ( ) const
inline

Return iteration index.

Definition at line 57 of file solverControlI.H.

◆ averageIter() [1/2]

Foam::label & averageIter ( )
inline

Return average iteration index reference.

Definition at line 63 of file solverControlI.H.

Referenced by incompressibleAdjointVars::computeMeanFields(), RASModelVariables::computeMeanFields(), incompressibleVars::computeMeanFields(), adjointRASModel::computeMeanFields(), incompressibleAdjointVars::resetMeanFields(), and incompressibleVars::resetMeanFields().

Here is the caller graph for this function:

◆ averageIter() [2/2]

Foam::label averageIter ( ) const
inline

Return const average iteration index reference.

Definition at line 69 of file solverControlI.H.

◆ averageStartIter()

Foam::label averageStartIter ( ) const
inline

Return iteration index.

Definition at line 75 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 81 of file solverControlI.H.

Referenced by incompressibleAdjointVars::computeMeanFields(), RASModelVariables::computeMeanFields(), incompressibleVars::computeMeanFields(), and adjointRASModel::computeMeanFields().

Here is the caller graph for this function:

◆ useAveragedFields()

bool useAveragedFields ( ) const
inline

Use averaged fields? For solving the adjoint equations or computing sensitivities based on averaged fields

Definition at line 94 of file solverControlI.H.

Referenced by adjointRASModel::getAdjointTMVariable1(), adjointRASModel::getAdjointTMVariable2(), RASModelVariables::nutRef(), incompressibleVars::p(), incompressibleAdjointMeanFlowVars::pa(), incompressibleVars::phi(), incompressibleAdjointMeanFlowVars::phia(), RASModelVariables::TMVar1(), RASModelVariables::TMVar2(), incompressibleVars::U(), and incompressibleAdjointMeanFlowVars::Ua().

Here is the caller graph for this function:

◆ average()

Member Data Documentation

◆ solver_

const solver& solver_
protected

Reference to the underlaying solver.

Definition at line 58 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 64 of file solverControl.H.

Referenced by solverControl::read().

◆ iter_

label iter_
protected

Current iteration index.

Definition at line 70 of file solverControl.H.

◆ averageIter_

label averageIter_
protected

Current averaging iteration index.

Definition at line 73 of file solverControl.H.

◆ averageStartIter_

label averageStartIter_
protected

Averaging start index.

Definition at line 76 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 82 of file solverControl.H.

◆ average_

bool average_
protected

Do averaging.

Definition at line 85 of file solverControl.H.

Referenced by SIMPLEControl::read().


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