All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
convergenceControl Class Referenceabstract

Convergence control class. Provides methods to check the convergence of the time loop against an absolute residual tolerance. More...

Inheritance diagram for convergenceControl:
Collaboration diagram for convergenceControl:

Classes

struct  residualData
 Classes. More...
 

Public Member Functions

 TypeName ("convergenceControl")
 Run-time type information. More...
 
 convergenceControl (const solutionControl &control)
 Construct from a solution control. More...
 
 convergenceControl (const convergenceControl &)=delete
 Disallow default bitwise copy construction. More...
 
virtual ~convergenceControl ()
 Destructor. More...
 
virtual bool hasResidualControls () const =0
 Return true if residual controls are present. More...
 
virtual bool criteriaSatisfied () const =0
 Return true if all convergence checks are satisfied. More...
 
bool converged ()
 Flag to indicate whether convergence has been reached. More...
 
bool endIfConverged (Time &time)
 End the run if convergence has been reached. More...
 
void operator= (const convergenceControl &)=delete
 Disallow default bitwise assignment. More...
 
template<class ResidualData >
Foam::label residualControlIndex (const word &fieldName, const List< ResidualData > &residualControl, const bool useRegEx)
 

Static Public Member Functions

static DynamicList< wordgetFieldNames (const fvMesh &mesh)
 Get the list of names of the fields. More...
 
static void getInitialResiduals (const fvMesh &mesh, const word &fieldName, const label solvei, scalar &r0, scalar &r)
 Get the initial residuals for the first and the i-th solves in this. More...
 
template<class ResidualData >
static label residualControlIndex (const word &fieldName, const List< ResidualData > &residualControl, const bool useRegEx=true)
 Return the index of the named field in residual control data, or -1. More...
 
template<class Type >
static void getFieldTypeNames (const fvMesh &mesh, DynamicList< word > &fieldNames)
 Append the of names of the fields of this Type to the given list. More...
 
template<class Type >
static void getInitialTypeResiduals (const fvMesh &mesh, const word &fieldName, const label solvei, scalar &r0, scalar &r)
 Get the initial residuals for the first and the i-th solves in this. More...
 

Protected Attributes

const solutionControlcontrol_
 Reference to the solution control. More...
 

Detailed Description

Convergence control class. Provides methods to check the convergence of the time loop against an absolute residual tolerance.

Source files

Definition at line 51 of file convergenceControl.H.

Constructor & Destructor Documentation

◆ convergenceControl() [1/2]

convergenceControl ( const solutionControl control)

Construct from a solution control.

Definition at line 75 of file convergenceControl.C.

◆ convergenceControl() [2/2]

convergenceControl ( const convergenceControl )
delete

Disallow default bitwise copy construction.

◆ ~convergenceControl()

~convergenceControl ( )
virtual

Destructor.

Definition at line 83 of file convergenceControl.C.

Member Function Documentation

◆ getFieldNames()

Foam::DynamicList< Foam::word > getFieldNames ( const fvMesh mesh)
static

Get the list of names of the fields.

for which residual data is available

Definition at line 40 of file convergenceControl.C.

References fieldNames, convergenceControl::getInitialResiduals(), and mesh.

Referenced by singleRegionCorrectorConvergenceControl::corrCriteriaSatisfied(), and singleRegionCorrectorConvergenceControl::updateCorrSolveIndex().

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

◆ getInitialResiduals()

void getInitialResiduals ( const fvMesh mesh,
const word fieldName,
const label  solvei,
scalar &  r0,
scalar &  r 
)
static

Get the initial residuals for the first and the i-th solves in this.

time-step

Definition at line 57 of file convergenceControl.C.

References mesh.

Referenced by singleRegionCorrectorConvergenceControl::corrCriteriaSatisfied(), and convergenceControl::getFieldNames().

Here is the caller graph for this function:

◆ residualControlIndex() [1/2]

static label residualControlIndex ( const word fieldName,
const List< ResidualData > &  residualControl,
const bool  useRegEx = true 
)
static

Return the index of the named field in residual control data, or -1.

if not present

Referenced by singleRegionCorrectorConvergenceControl::corrCriteriaSatisfied(), and singleRegionCorrectorConvergenceControl::readCorrResidualControls().

Here is the caller graph for this function:

◆ getFieldTypeNames()

void getFieldTypeNames ( const fvMesh mesh,
DynamicList< word > &  fieldNames 
)
static

Append the of names of the fields of this Type to the given list.

Definition at line 56 of file convergenceControlTemplates.C.

References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), and convergenceControl::getInitialTypeResiduals().

Referenced by convergenceControl::residualControlIndex().

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

◆ getInitialTypeResiduals()

void getInitialTypeResiduals ( const fvMesh mesh,
const word fieldName,
const label  solvei,
scalar &  r0,
scalar &  r 
)
static

Get the initial residuals for the first and the i-th solves in this.

time-step

Definition at line 67 of file convergenceControlTemplates.C.

References Foam::cmptMax(), and objectRegistry::foundObject().

Referenced by convergenceControl::getFieldTypeNames().

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

◆ TypeName()

TypeName ( "convergenceControl"  )

Run-time type information.

◆ hasResidualControls()

virtual bool hasResidualControls ( ) const
pure virtual

Return true if residual controls are present.

Implemented in pimpleMultiRegionControl, and singleRegionConvergenceControl.

◆ criteriaSatisfied()

virtual bool criteriaSatisfied ( ) const
pure virtual

Return true if all convergence checks are satisfied.

Implemented in pimpleMultiRegionControl, and singleRegionConvergenceControl.

Referenced by convergenceControl::converged().

Here is the caller graph for this function:

◆ converged()

bool converged ( )

Flag to indicate whether convergence has been reached.

Definition at line 89 of file convergenceControl.C.

References solutionControl::algorithmName(), convergenceControl::control_, convergenceControl::criteriaSatisfied(), Foam::endl(), Foam::Info, Foam::nl, Time::startTimeIndex(), solutionControl::time(), TimeState::timeIndex(), and Time::timeName().

Referenced by convergenceControl::endIfConverged().

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

◆ endIfConverged()

bool endIfConverged ( Time time)

End the run if convergence has been reached.

Definition at line 107 of file convergenceControl.C.

References convergenceControl::converged(), Time::noWriteNow, Time::setEndTime(), Time::stopAt(), Time::writeAndEnd(), and TimeState::writeTime().

Referenced by simpleControl::loop(), pimpleControl::loop(), simpleControl::run(), and pimpleControl::run().

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

◆ operator=()

void operator= ( const convergenceControl )
delete

Disallow default bitwise assignment.

◆ residualControlIndex() [2/2]

Foam::label residualControlIndex ( const word fieldName,
const List< ResidualData > &  residualControl,
const bool  useRegEx 
)

Definition at line 32 of file convergenceControlTemplates.C.

References forAll, convergenceControl::getFieldTypeNames(), string::match(), and Foam::name().

Here is the call graph for this function:

Member Data Documentation

◆ control_

const solutionControl& control_
protected

Reference to the solution control.

Definition at line 121 of file convergenceControl.H.

Referenced by convergenceControl::converged().


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