cvControls.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) 2012-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::cvControls
26 
27 Description
28  Controls for the conformalVoronoiMesh mesh generator
29 
30 SourceFiles
31  cvControls.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef cvControls_H
36 #define cvControls_H
37 
38 #include "dictionary.H"
39 #include "Switch.H"
40 #include "vector.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // Forward declaration of classes
48 class conformalVoronoiMesh;
49 
50 /*---------------------------------------------------------------------------*\
51  Class cvControls Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class cvControls
55 {
56  // Private Data
57 
58  //- Reference to the foamyHexMeshDict
59  const dictionary& foamyHexMeshDict_;
60 
61  // Surface conformation controls
62 
63  //- Point pair spacing coefficient - fraction of the local target
64  // cell size
65  scalar pointPairDistanceCoeff_;
66 
67  //- Distance along feature edge to place mixed feature point
68  // conformation groups - to be multiple of pointPairDistanceCoeff_.
69  scalar mixedFeaturePointPPDistanceCoeff_;
70 
71  //- Distance to a feature point within which surface and edge
72  // conformation points are excluded - fraction of the local target
73  // cell size
74  scalar featurePointExclusionDistanceCoeff_;
75 
76  //- Distance to an existing feature edge conformation location
77  // within which other edge conformation location are excluded -
78  // fraction of the local target cell size
79  scalar featureEdgeExclusionDistanceCoeff_;
80 
81 
82  //- Surface search distance coefficient - fraction of the local
83  // target cell size
84  scalar surfaceSearchDistanceCoeff_;
85 
86  //- Maximum allowable protrusion through the surface before
87  // conformation points are added - fraction of the local target
88  // cell size
89  scalar maxSurfaceProtrusionCoeff_;
90 
91  //- Maximum quadrant angle allowed at a concave edge before
92  // additional "mitering" lines are added
93  scalar maxQuadAngle_;
94 
95  //- Now often to rebuild the surface conformation
96  label surfaceConformationRebuildFrequency_;
97 
98  // Controls for feature point conformation
99 
100  //-
101  Switch guardFeaturePoints_;
102 
103  //-
104  Switch edgeAiming_;
105 
106  //-
107  Switch snapFeaturePoints_;
108 
109  //-
110  Switch circulateEdges_;
111 
112  //- Switch for using specialised feature points
113  Switch specialiseFeaturePoints_;
114 
115 
116  // Controls for coarse surface conformation
117 
118  //- Distance to an existing surface conformation point location
119  // within which other surface point locations are excluded
120  // - fraction of the local target cell size
121  scalar surfacePtExclusionDistanceCoeff_;
122 
123  //- Distance to search for feature edges near to
124  // surface protrusions - fraction of the local target
125  // cell size.
126  scalar edgeSearchDistCoeffSqr_;
127 
128  //- Proximity to a feature edge where a surface hit is
129  // not created, only the edge conformation is created
130  // - fraction of the local target cell size.
131  scalar surfacePtReplaceDistCoeffSqr_;
132 
133  //- Maximum allowed number surface conformation iterations.
134  label maxConformationIterations_;
135 
136  //- Termination criterion for conformation iterations.
137  // When the number of surface protrusions drops below this
138  // ratio of the initial number of protrusions.
139  scalar iterationToInitialHitRatioLimit_;
140 
141 
142  // Motion control controls
143 
144 
145  // Cell size criteria
146 
147  //- Default cell size
148  scalar defaultCellSize_;
149 
150  //- Minimum cell size
151  scalar minimumCellSize_;
152 
153 
154  //- Switch to control the output of obj files for debug
155  Switch objOutput_;
156 
157  //- Switch to control the reporting of detailed timeChecks
158  Switch timeChecks_;
159 
160  //- Switch to control the reporting of detailed vertex information
161  Switch printVertexInfo_;
162 
163  //- Allowed relative load unbalance
164  scalar maxLoadUnbalance_;
165 
166  //- Cosine of angle of alignment with required direction within which a
167  // face will be accepted for rotation
168  scalar cosAlignmentAcceptanceAngle_;
169 
170 
171  // Point insertion criteria
172 
173  //- Length between Delaunay vertices above which a new Dv should be
174  // inserted - fraction of the local target cell size
175  scalar insertionDistCoeff_;
176 
177  //- Minimum dual face area corresponding to long Delaunay edge where
178  // a new Dv is to be inserted - fraction of the local target cell
179  // size
180  scalar faceAreaRatioCoeff_;
181 
182  //- Cosine of the angle of alignment with the required direction
183  // within which a long De will be accepted for a new Dv insertion
184  scalar cosInsertionAcceptanceAngle_;
185 
186 
187  // Point removal criteria
188 
189  //- Length between Delaunay vertices below which a Dv should be
190  // removed - fraction of the local target cell size
191  scalar removalDistCoeff_;
192 
193 
194  // polyMesh filtering controls
195 
196  //- Activates the mesh edge filtering. On by default.
197  Switch filterEdges_;
198 
199  //- Activates the mesh face filtering. Off by default.
200  Switch filterFaces_;
201 
202  //- Write tet mesh at output time (it always writes the Voronoi)
203  Switch writeTetDualMesh_;
204 
205  Switch writeCellShapeControlMesh_;
206 
207  Switch writeBackgroundMeshDecomposition_;
208 
209 
210 public:
211 
212  // Constructors
213 
214  //- Construct from references to conformalVoronoiMesh and dictionary
215  cvControls
216  (
218  );
219 
220  //- Disallow default bitwise copy construction
221  cvControls(const cvControls&) = delete;
222 
223 
224  //- Destructor
225  ~cvControls();
226 
227 
228  // Member Functions
229 
230  // Access
231 
232  //- Return the foamyHexMeshDict
233  inline const dictionary& foamyHexMeshDict() const;
234 
235  //- Return the pointPairDistanceCoeff
236  inline scalar pointPairDistanceCoeff() const;
237 
238  //- Return the mixedFeaturePointPPDistanceCoeff
239  inline scalar mixedFeaturePointPPDistanceCoeff() const;
240 
241  //- Return the featurePointExclusionDistanceCoeff
242  inline scalar featurePointExclusionDistanceCoeff() const;
243 
244  //- Return the featureEdgeExclusionDistanceCoeff
245  inline scalar featureEdgeExclusionDistanceCoeff() const;
246 
247  //-
248  inline Switch guardFeaturePoints() const;
249 
250  //-
251  inline Switch edgeAiming() const;
252 
253  //-
254  inline Switch snapFeaturePoints() const;
255 
256  //-
257  inline Switch circulateEdges() const;
258 
259  //- Return the surfacePtExclusionDistanceCoeff
260  inline scalar surfacePtExclusionDistanceCoeff() const;
261 
262  //- Return whether to use specialised feature points
263  inline Switch specialiseFeaturePoints() const;
264 
265  //- Return the surfaceSearchDistanceCoeff
266  inline scalar surfaceSearchDistanceCoeff() const;
267 
268  //- Return the maxSurfaceProtrusionCoeff
269  inline scalar maxSurfaceProtrusionCoeff() const;
270 
271  //- Return the maxQuadAngle
272  inline scalar maxQuadAngle() const;
273 
274  //- Return the surfaceConformationRebuildFrequency
276 
277  //- Return the edgeSearchDistCoeffSqr for conformation.
278  scalar edgeSearchDistCoeffSqr() const;
279 
280  //- Return the surfacePtReplaceDistCoeffSqr for conformation.
281  scalar surfacePtReplaceDistCoeffSqr() const;
282 
283  //- Return the maxConformationIterations
285 
286  //- Return the iterationToInitialHitRatioLimit
287  scalar iterationToInitialHitRatioLimit() const;
288 
289  //- Return the defaultCellSize
290  inline scalar defaultCellSize() const;
291 
292  //- Return the minimumCellSize
293  inline scalar minimumCellSize() const;
294 
295  //- Return the objOutput Switch
296  inline Switch objOutput() const;
297 
298  //- Return the timeChecks Switch
299  inline Switch timeChecks() const;
300 
301  //- Return the printVertexInfo Switch
302  inline Switch printVertexInfo() const;
303 
304  //- Return the maxLoadUnbalance
305  inline scalar maxLoadUnbalance() const;
306 
307  //- Return the cosAlignmentAcceptanceAngle
308  inline scalar cosAlignmentAcceptanceAngle() const;
309 
310  //- Return the aspectRatio
311  inline scalar aspectRatio() const;
312 
313  //- Return the aspectRatioDirection
314  inline const vector& aspectRatioDirection() const;
315 
316  //- Return the insertionDistCoeff
317  inline scalar insertionDistCoeff() const;
318 
319  //- Return the faceAreaRatioCoeff
320  inline scalar faceAreaRatioCoeff() const;
321 
322  //- Return the cosInsertionAcceptanceAngle
323  inline scalar cosInsertionAcceptanceAngle() const;
324 
325  //- Return removalDistCoeff
326  inline scalar removalDistCoeff() const;
327 
328  //- Filter edges at output time
329  inline Switch filterEdges() const;
330 
331  //- Filter faces at output time
332  inline Switch filterFaces() const;
333 
334  //- Write tetMesh at output time
335  inline Switch writeTetDualMesh() const;
336 
337  //- Write cellShapeControlMesh at output time
338  inline Switch writeCellShapeControlMesh() const;
339 
340  //- Write backgroundMeshDecomposition at output time
342 
343 
344  // Member Operators
345 
346  //- Disallow default bitwise assignment
347  void operator=(const cvControls&) = delete;
348 };
349 
350 
351 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
352 
353 } // End namespace Foam
354 
355 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
356 
357 #include "cvControlsI.H"
358 
359 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
360 
361 #endif
362 
363 // ************************************************************************* //
cvControls(const dictionary &foamyHexMeshDict)
Construct from references to conformalVoronoiMesh and dictionary.
scalar aspectRatio() const
Return the aspectRatio.
Switch printVertexInfo() const
Return the printVertexInfo Switch.
Definition: cvControlsI.H:161
void operator=(const cvControls &)=delete
Disallow default bitwise assignment.
scalar pointPairDistanceCoeff() const
Return the pointPairDistanceCoeff.
Definition: cvControlsI.H:34
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
scalar cosAlignmentAcceptanceAngle() const
Return the cosAlignmentAcceptanceAngle.
Definition: cvControlsI.H:173
Switch writeTetDualMesh() const
Write tetMesh at output time.
Definition: cvControlsI.H:213
scalar surfaceSearchDistanceCoeff() const
Return the surfaceSearchDistanceCoeff.
Definition: cvControlsI.H:89
const vector & aspectRatioDirection() const
Return the aspectRatioDirection.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
Definition: Switch.H:60
scalar faceAreaRatioCoeff() const
Return the faceAreaRatioCoeff.
Definition: cvControlsI.H:185
label surfaceConformationRebuildFrequency() const
Return the surfaceConformationRebuildFrequency.
Definition: cvControlsI.H:107
const dictionary & foamyHexMeshDict() const
Return the foamyHexMeshDict.
Definition: cvControlsI.H:28
scalar featureEdgeExclusionDistanceCoeff() const
Return the featureEdgeExclusionDistanceCoeff.
Definition: cvControlsI.H:52
scalar removalDistCoeff() const
Return removalDistCoeff.
Definition: cvControlsI.H:197
scalar defaultCellSize() const
Return the defaultCellSize.
Definition: cvControlsI.H:137
scalar maxQuadAngle() const
Return the maxQuadAngle.
Definition: cvControlsI.H:101
scalar featurePointExclusionDistanceCoeff() const
Return the featurePointExclusionDistanceCoeff.
Definition: cvControlsI.H:46
scalar surfacePtExclusionDistanceCoeff() const
Return the surfacePtExclusionDistanceCoeff.
Definition: cvControlsI.H:79
scalar maxSurfaceProtrusionCoeff() const
Return the maxSurfaceProtrusionCoeff.
Definition: cvControlsI.H:95
~cvControls()
Destructor.
scalar edgeSearchDistCoeffSqr() const
Return the edgeSearchDistCoeffSqr for conformation.
Definition: cvControlsI.H:113
Switch filterFaces() const
Filter faces at output time.
Definition: cvControlsI.H:208
Switch writeBackgroundMeshDecomposition() const
Write backgroundMeshDecomposition at output time.
Definition: cvControlsI.H:223
Switch timeChecks() const
Return the timeChecks Switch.
Definition: cvControlsI.H:155
Switch edgeAiming() const
Definition: cvControlsI.H:63
scalar minimumCellSize() const
Return the minimumCellSize.
Definition: cvControlsI.H:143
label maxConformationIterations() const
Return the maxConformationIterations.
Definition: cvControlsI.H:125
Switch objOutput() const
Return the objOutput Switch.
Definition: cvControlsI.H:149
Switch snapFeaturePoints() const
Definition: cvControlsI.H:68
scalar maxLoadUnbalance() const
Return the maxLoadUnbalance.
Definition: cvControlsI.H:167
Controls for the conformalVoronoiMesh mesh generator.
Definition: cvControls.H:53
scalar iterationToInitialHitRatioLimit() const
Return the iterationToInitialHitRatioLimit.
Definition: cvControlsI.H:131
Switch filterEdges() const
Filter edges at output time.
Definition: cvControlsI.H:203
Switch writeCellShapeControlMesh() const
Write cellShapeControlMesh at output time.
Definition: cvControlsI.H:218
scalar cosInsertionAcceptanceAngle() const
Return the cosInsertionAcceptanceAngle.
Definition: cvControlsI.H:191
Switch circulateEdges() const
Definition: cvControlsI.H:73
Switch specialiseFeaturePoints() const
Return whether to use specialised feature points.
Definition: cvControlsI.H:84
scalar insertionDistCoeff() const
Return the insertionDistCoeff.
Definition: cvControlsI.H:179
scalar surfacePtReplaceDistCoeffSqr() const
Return the surfacePtReplaceDistCoeffSqr for conformation.
Definition: cvControlsI.H:119
Switch guardFeaturePoints() const
Definition: cvControlsI.H:58
scalar mixedFeaturePointPPDistanceCoeff() const
Return the mixedFeaturePointPPDistanceCoeff.
Definition: cvControlsI.H:40
Namespace for OpenFOAM.