refinementParameters.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) 2011-2021 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::refinementParameters
26 
27 Description
28  Simple container to keep together refinement specific information.
29 
30 SourceFiles
31  refinementParameters.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef refinementParameters_H
36 #define refinementParameters_H
37 
38 #include "dictionary.H"
39 #include "labelList.H"
40 #include "point.H"
41 #include "Switch.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Class forward declarations
49 class polyMesh;
50 
51 /*---------------------------------------------------------------------------*\
52  Class refinementParameters Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 {
57 public:
58 
59  // Public classes
60 
61  //- Class to hold the points to select cells inside and outside
62  // surface regions
64  {
65  //- Points inside the surface regions to selected cells
66  const List<point> inside_;
67 
68  //- Points outside the surface region to deselect cells
69  const List<point> outside_;
70 
71 
72  public:
73 
74  //- Constructor
76 
77  //- Return the points inside the surface regions to selected cells
78  const List<point>& inside() const
79  {
80  return inside_;
81  }
82 
83  //- Return the points outside the surface region to deselect cells
84  const List<point>& outside() const
85  {
86  return outside_;
87  }
88  };
89 
90 
91 private:
92 
93  // Private Data
94 
95  //- Total number of cells
96  const label maxGlobalCells_;
97 
98  //- Per processor max number of cells
99  const label maxLocalCells_;
100 
101  //- When to stop refining
102  const label minRefineCells_;
103 
104  //- Curvature
105  scalar curvature_;
106 
107  //- Planarity criterion
108  scalar planarAngle_;
109 
110  //- Number of layers between different refinement levels
111  const label nBufferLayers_;
112 
113  //- Points to select cells inside and outside surface regions
114  const cellSelectionPoints selectionPoints_;
115 
116  //- FaceZone faces allowed which have owner and neighbour in same
117  // cellZone?
118  Switch allowFreeStandingZoneFaces_;
119 
120  //- Use old topology based problem-cell removal (cells with 8 points
121  // on surface)
122  Switch useTopologicalSnapDetection_;
123 
124  //- Allowed load unbalance
125  scalar maxLoadUnbalance_;
126 
127  Switch handleSnapProblems_;
128 
129 
130 public:
131 
132  // Constructors
133 
134  //- Construct from dictionary - new syntax
136 
137  //- Disallow default bitwise copy construction
139 
140 
141  // Member Functions
142 
143  // Access
144 
145  //- Total number of cells
146  label maxGlobalCells() const
147  {
148  return maxGlobalCells_;
149  }
150 
151  //- Per processor max number of cells
152  label maxLocalCells() const
153  {
154  return maxLocalCells_;
155  }
156 
157  //- When to stop refining
158  label minRefineCells() const
159  {
160  return minRefineCells_;
161  }
162 
163  //- Curvature
164  scalar curvature() const
165  {
166  return curvature_;
167  }
168 
169  //- Angle when two intersections are considered to be planar
170  scalar planarAngle() const
171  {
172  return planarAngle_;
173  }
174 
175  //- Number of layers between different refinement levels
176  label nBufferLayers() const
177  {
178  return nBufferLayers_;
179  }
180 
181  //- Return the points to select cells inside and outside
182  // surface regions
183  const cellSelectionPoints& selectionPoints() const
184  {
185  return selectionPoints_;
186  }
187 
188  //- Are zone faces allowed only in between different cell zones
189  // or also just free standing?
190  bool allowFreeStandingZoneFaces() const
191  {
192  return allowFreeStandingZoneFaces_;
193  }
194 
195  //- Use old topology based problem-cell removal
196  // (cells with 8 points on surface)
197  bool useTopologicalSnapDetection() const
198  {
199  return useTopologicalSnapDetection_;
200  }
201 
202  //- Allowed load unbalance
203  scalar maxLoadUnbalance() const
204  {
205  return maxLoadUnbalance_;
206  }
207 
208  bool handleSnapProblems() const
209  {
210  return handleSnapProblems_;
211  }
212 
213 
214  // Other
215 
216  //- Checks that cells are in mesh. Returns cells they are in.
217  labelList findCells(const polyMesh&) const;
218 
219 
220  // Member Operators
221 
222  //- Disallow default bitwise assignment
223  void operator=(const refinementParameters&) = delete;
224 };
225 
226 
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 
229 } // End namespace Foam
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 #endif
234 
235 // ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:91
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:61
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
Class to hold the points to select cells inside and outside.
const List< point > & outside() const
Return the points outside the surface region to deselect cells.
cellSelectionPoints(const dictionary &dict)
Constructor.
const List< point > & inside() const
Return the points inside the surface regions to selected cells.
Simple container to keep together refinement specific information.
refinementParameters(const dictionary &dict)
Construct from dictionary - new syntax.
scalar planarAngle() const
Angle when two intersections are considered to be planar.
label maxLocalCells() const
Per processor max number of cells.
scalar curvature() const
Curvature.
label minRefineCells() const
When to stop refining.
bool useTopologicalSnapDetection() const
Use old topology based problem-cell removal.
void operator=(const refinementParameters &)=delete
Disallow default bitwise assignment.
scalar maxLoadUnbalance() const
Allowed load unbalance.
bool allowFreeStandingZoneFaces() const
Are zone faces allowed only in between different cell zones.
label maxGlobalCells() const
Total number of cells.
const cellSelectionPoints & selectionPoints() const
Return the points to select cells inside and outside.
label nBufferLayers() const
Number of layers between different refinement levels.
labelList findCells(const polyMesh &) const
Checks that cells are in mesh. Returns cells they are in.
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
dictionary dict