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