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-2020 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 public:
72 
73  // Static Data Members
74 
75  //- Run-time type information
76  TypeName("singleRegionCorrectorConvergenceControl");
77 
78 
79  // Constructors
80 
81  //- Construct from a solution control and the loop name
83  (
84  const singleRegionSolutionControl& control,
85  const word& loopName
86  );
87 
88 
89  //- Destructor
91 
92 
93  // Member Functions
94 
95  // IO
96 
97  //- Read residual controls
99 
100  //- Print the residual controls
101  void printCorrResidualControls(const label n) const;
102 
103 
104  // Evolution
105 
106  //- Return true if corrector residual controls are present
107  virtual bool hasCorrResidualControls() const;
108 
109  //- Return true if all correction convergence checks are satisfied
110  virtual bool corrCriteriaSatisfied() const;
111 
112  //- Reset the solve index in the correction residual control data
113  virtual void resetCorrSolveIndex();
114 
115  //- Update the solve index in the correction residual control data
116  virtual void updateCorrSolveIndex();
117 };
118 
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 } // End namespace Foam
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 #endif
127 
128 // ************************************************************************* //
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:101
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