singleRegionCorrectorConvergenceControl.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2018-2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::singleRegionCorrectorConvergenceControl
26 
27 Description
28  Single-region-specific derivation of the corrector convergence control
29  class
30 
31 SourceFiles
32  singleRegionCorrectorConvergenceControl.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef singleRegionCorrectorConvergenceControl_H
37 #define singleRegionCorrectorConvergenceControl_H
38 
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class singleRegionCorrectorConvergenceControl Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 :
54 {
55 protected:
56 
57  // Protected data
58 
59  //- Reference to the mesh
60  const fvMesh& mesh_;
61 
62  //- List of residual data per field
64 
65  //- The index of the solution at the start of the corrector loop, for
66  // each field. If the field name is not in the table then the index is
67  // assumed to be zero; i.e, the first solution.
69 
70 
71  // Protected Member Functions
72 
73  //- Read controls
74  virtual bool read();
75 
76 
77 public:
78 
79  // Static Data Members
80 
81  //- Run-time type information
82  TypeName("singleRegionCorrectorConvergenceControl");
83 
84 
85  // Constructors
86 
87  //- Construct from a solution control and the loop name
89  (
90  const singleRegionSolutionControl& control,
91  const word& loopName
92  );
93 
94 
95  //- Destructor
97 
98 
99  // Member Functions
100 
101  // IO
102 
103  //- Print the residual controls
104  void printCorrResidualControls(const label n) const;
105 
106 
107  // Evolution
108 
109  //- Return true if corrector residual controls are present
110  virtual bool hasCorrResidualControls() const;
111 
112  //- Return true if all correction convergence checks are satisfied
113  virtual bool corrCriteriaSatisfied() const;
114 
115  //- Reset the solve index in the correction residual control data
116  virtual void resetCorrSolveIndex();
117 
118  //- Update the solve index in the correction residual control data
119  virtual void updateCorrSolveIndex();
120 };
121 
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 } // End namespace Foam
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 #endif
130 
131 // ************************************************************************* //
label n
Corrector convergence control class. Provides methods to check the convergence of an inner iteration ...
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
Single-region-specific derivation of the corrector convergence control class.
TypeName("singleRegionCorrectorConvergenceControl")
Run-time type information.
void printCorrResidualControls(const label n) const
Print the residual controls.
virtual bool hasCorrResidualControls() const
Return true if corrector residual controls are present.
virtual void resetCorrSolveIndex()
Reset the solve index in the correction residual control data.
virtual void updateCorrSolveIndex()
Update the solve index in the correction residual control data.
List< corrResidualData > corrResidualControl_
List of residual data per field.
virtual bool corrCriteriaSatisfied() const
Return true if all correction convergence checks are satisfied.
singleRegionCorrectorConvergenceControl(const singleRegionSolutionControl &control, const word &loopName)
Construct from a solution control and the loop name.
HashTable< label > solveIndex_
The index of the solution at the start of the corrector loop, for.
Single-region-specific derivation of the solution control class.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59