Loading...
Searching...
No Matches
solverControl Class Reference

Base class for solver control classes. More...

#include <solverControl.H>

Inheritance diagram for solverControl:
Collaboration diagram for solverControl:

Public Member Functions

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

Protected Member Functions

virtual bool read ()
 Read controls from optimisationDict.

Protected Attributes

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

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 average_, averageIter_, averageStartIter_, iter_, printMaxMags_, read(), solutionDict(), solver_, solverDict(), and storeInitValues_.

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 averageStartIter_, dictionary::getOrDefault(), printMaxMags_, solutionDict(), and dictionary::subOrEmptyDict().

Referenced by SIMPLEControl::read(), and 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_.

Referenced by solutionDict(), and solverControl().

Here is the caller graph for this function:

◆ solutionDict()

const Foam::dictionary solutionDict ( ) const
inlinevirtual

Return the solutionControls dictionary.

Definition at line 32 of file solverControlI.H.

References solverDict().

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

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.

References printMaxMags_.

◆ storeInitValues()

bool storeInitValues ( ) const
inline

Re-initialize.

Definition at line 44 of file solverControlI.H.

References storeInitValues_.

Referenced by adjointRASModel::restoreInitValues().

Here is the caller graph for this function:

◆ iter()

Foam::label iter ( ) const
inline

Return iteration index.

Definition at line 50 of file solverControlI.H.

References iter_.

◆ averageIter() [1/2]

Foam::label & averageIter ( )
inline

Return average iteration index reference.

Definition at line 56 of file solverControlI.H.

References averageIter_.

Referenced by objective::accumulateJMean(), and adjointRASModel::computeMeanFields().

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 62 of file solverControlI.H.

References averageIter_.

◆ averageStartIter()

Foam::label averageStartIter ( ) const
inline

Return iteration index.

Definition at line 68 of file solverControlI.H.

References averageStartIter_.

◆ 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.

References average_, averageStartIter_, and iter_.

Referenced by objective::accumulateJMean(), 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 87 of file solverControlI.H.

References average_, and averageIter_.

◆ average()

bool average ( ) const
inline

Whether averaging is enabled or not.

Definition at line 100 of file solverControlI.H.

References average_.

Referenced by adjointRASModel::resetMeanFields(), and adjointRASModel::setMeanFields().

Here is the caller graph for this function:

◆ getSolver()

const Foam::solver & getSolver ( ) const
inline

Return reference to the underlaying solver.

Definition at line 106 of file solverControlI.H.

References solver_.

Member Data Documentation

◆ solver_

◆ 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 printMaxMags(), read(), and solverControl().

◆ iter_

◆ averageIter_

label averageIter_
protected

Current averaging iteration index.

Definition at line 76 of file solverControl.H.

Referenced by averageIter(), averageIter(), solverControl(), and useAveragedFields().

◆ averageStartIter_

label averageStartIter_
protected

Averaging start index.

Definition at line 81 of file solverControl.H.

Referenced by averageStartIter(), SIMPLEControl::checkMeanSolution(), doAverageIter(), SIMPLEControl::read(), read(), and solverControl().

◆ 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.

Referenced by solverControl(), and storeInitValues().

◆ average_

bool average_
protected

The documentation for this class was generated from the following files:
  • src/optimisation/adjointOptimisation/adjoint/solvers/solverControl/solverControl/solverControl.H
  • src/optimisation/adjointOptimisation/adjoint/solvers/solverControl/solverControl/solverControl.C
  • src/optimisation/adjointOptimisation/adjoint/solvers/solverControl/solverControl/solverControlI.H