cvControls.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2012-2015 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  // Private Member Functions
211 
212  //- Disallow default bitwise copy construct
213  cvControls(const cvControls&);
214 
215  //- Disallow default bitwise assignment
216  void operator=(const cvControls&);
217 
218 
219 public:
220 
221  // Constructors
222 
223  //- Construct from references to conformalVoronoiMesh and dictionary
224  cvControls
225  (
227  );
228 
229 
230  //- Destructor
231  ~cvControls();
232 
233 
234  // Member Functions
235 
236  // Access
237 
238  //- Return the foamyHexMeshDict
239  inline const dictionary& foamyHexMeshDict() const;
240 
241  //- Return the pointPairDistanceCoeff
242  inline scalar pointPairDistanceCoeff() const;
243 
244  //- Return the mixedFeaturePointPPDistanceCoeff
245  inline scalar mixedFeaturePointPPDistanceCoeff() const;
246 
247  //- Return the featurePointExclusionDistanceCoeff
248  inline scalar featurePointExclusionDistanceCoeff() const;
249 
250  //- Return the featureEdgeExclusionDistanceCoeff
251  inline scalar featureEdgeExclusionDistanceCoeff() const;
252 
253  //-
254  inline Switch guardFeaturePoints() const;
255 
256  //-
257  inline Switch edgeAiming() const;
258 
259  //-
260  inline Switch snapFeaturePoints() const;
261 
262  //-
263  inline Switch circulateEdges() const;
264 
265  //- Return the surfacePtExclusionDistanceCoeff
266  inline scalar surfacePtExclusionDistanceCoeff() const;
267 
268  //- Return whether to use specialised feature points
269  inline Switch specialiseFeaturePoints() const;
270 
271  //- Return the surfaceSearchDistanceCoeff
272  inline scalar surfaceSearchDistanceCoeff() const;
273 
274  //- Return the maxSurfaceProtrusionCoeff
275  inline scalar maxSurfaceProtrusionCoeff() const;
276 
277  //- Return the maxQuadAngle
278  inline scalar maxQuadAngle() const;
279 
280  //- Return the surfaceConformationRebuildFrequency
282 
283  //- Return the edgeSearchDistCoeffSqr for conformation.
284  scalar edgeSearchDistCoeffSqr() const;
285 
286  //- Return the surfacePtReplaceDistCoeffSqr for conformation.
287  scalar surfacePtReplaceDistCoeffSqr() const;
288 
289  //- Return the maxConformationIterations
291 
292  //- Return the iterationToInitialHitRatioLimit
293  scalar iterationToInitialHitRatioLimit() const;
294 
295  //- Return the defaultCellSize
296  inline scalar defaultCellSize() const;
297 
298  //- Return the minimumCellSize
299  inline scalar minimumCellSize() const;
300 
301  //- Return the objOutput Switch
302  inline Switch objOutput() const;
303 
304  //- Return the timeChecks Switch
305  inline Switch timeChecks() const;
306 
307  //- Return the printVertexInfo Switch
308  inline Switch printVertexInfo() const;
309 
310  //- Return the maxLoadUnbalance
311  inline scalar maxLoadUnbalance() const;
312 
313  //- Return the cosAlignmentAcceptanceAngle
314  inline scalar cosAlignmentAcceptanceAngle() const;
315 
316  //- Return the aspectRatio
317  inline scalar aspectRatio() const;
318 
319  //- Return the aspectRatioDirection
320  inline const vector& aspectRatioDirection() const;
321 
322  //- Return the insertionDistCoeff
323  inline scalar insertionDistCoeff() const;
324 
325  //- Return the faceAreaRatioCoeff
326  inline scalar faceAreaRatioCoeff() const;
327 
328  //- Return the cosInsertionAcceptanceAngle
329  inline scalar cosInsertionAcceptanceAngle() const;
330 
331  //- Return removalDistCoeff
332  inline scalar removalDistCoeff() const;
333 
334  //- Filter edges at output time
335  inline Switch filterEdges() const;
336 
337  //- Filter faces at output time
338  inline Switch filterFaces() const;
339 
340  //- Write tetMesh at output time
341  inline Switch writeTetDualMesh() const;
342 
343  //- Write cellShapeControlMesh at output time
344  inline Switch writeCellShapeControlMesh() const;
345 
346  //- Write backgroundMeshDecomposition at output time
348 };
349 
350 
351 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
352 
353 } // End namespace Foam
354 
355 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
356 
357 #include "cvControlsI.H"
358 
359 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
360 
361 #endif
362 
363 // ************************************************************************* //
scalar aspectRatio() const
Return the aspectRatio.
Switch printVertexInfo() const
Return the printVertexInfo Switch.
Definition: cvControlsI.H:161
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
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:137
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.
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.