cv2DControls.H
Go to the documentation of this file.
1 /*--------------------------------*- C++ -*----------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2019 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::cv2DControls
26 
27 Description
28  Controls for the 2D CV mesh generator.
29 
30 SourceFiles
31  cv2DControls.C
32  cv2DControlsI.H
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef cv2DControls_H
37 #define cv2DControls_H
38 
39 #include "Switch.H"
40 #include "dictionary.H"
41 #include "boundBox.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declaration of friend functions and operators
49 
50 class cv2DControls;
51 
52 Ostream& operator<<(Ostream&, const cv2DControls&);
53 
54 
55 /*---------------------------------------------------------------------------*\
56  Class cv2DControls Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class cv2DControls
60 {
61  // Private Data
62 
63  //- Description of data_
64  const dictionary& dict_;
65 
66  const dictionary& motionControl_;
67 
68  const dictionary& conformationControl_;
69 
70 
71 public:
72 
73  // Controls
74 
75  //- Minimum cell size below which protusions through the surface are
76  // not split
77  scalar minCellSize_;
78 
79  //- Square of minCellSize
80  scalar minCellSize2_;
81 
82  //- Maximum quadrant angle allowed at a concave corner before
83  // additional "mitering" lines are added
84  scalar maxQuadAngle_;
85 
86  //- Near-wall region where cells are aligned with the wall
87  scalar nearWallAlignedDist_;
88 
89  //- Square of nearWallAlignedDist
90  scalar nearWallAlignedDist2_;
91 
92  //- Insert near-boundary point mirror or point-pairs
94 
95  //- Mirror near-boundary points rather than insert point-pairs
97 
98  //- Insert point-pairs vor dual-cell vertices very near the surface
107  scalar randomPerturbation_;
110 
111 
112  // Tolerances
113 
114  //- Maximum cartesian span of the geometry
115  scalar span_;
116 
117  //- Square of span
118  scalar span2_;
119 
120  //- Minimum edge-length of the cell size below which protusions
121  // through the surface are not split
122  scalar minEdgeLen_;
123 
124  //- Square of minEdgeLen
125  scalar minEdgeLen2_;
126 
127  //- Maximum notch size below which protusions into the surface are
128  // not filled
129  scalar maxNotchLen_;
130 
131  //- Square of maxNotchLen
132  scalar maxNotchLen2_;
133 
134  //- The minimum distance allowed between a dual-cell vertex
135  // and the surface before a point-pair is introduced
136  scalar minNearPointDist_;
137 
138  //- Square of minNearPoint
139  scalar minNearPointDist2_;
140 
141  //- Distance between boundary conforming point-pairs
142  scalar ppDist_;
143 
144  //- Square of ppDist
145  scalar ppDist2_;
146 
147 
148  // Constructors
149 
151  (
152  const dictionary& controlDict,
153  const boundBox& bb
154  );
155 
156  //- Disallow default bitwise copy construction
157  cv2DControls(const cv2DControls&) = delete;
158 
159 
160  //- Destructor
161  ~cv2DControls();
162 
163 
164  // Member Functions
165 
166  // Access
167 
168  //- Return the minimum cell size
169  inline scalar minCellSize() const;
170 
171  //- Return the square of the minimum cell size
172  inline scalar minCellSize2() const;
173 
174  //- Return the maximum quadrant angle
175  inline scalar maxQuadAngle() const;
176 
177  //- Return number of layers to align with the nearest wall
178  inline scalar nearWallAlignedDist() const;
179 
180  //- Return square of nearWallAlignedDist
181  inline scalar nearWallAlignedDist2() const;
182 
183  //- Return insertSurfaceNearestPointPairs Switch
184  inline Switch insertSurfaceNearestPointPairs() const;
185 
186  //- Return mirrorPoints Switch
187  inline Switch mirrorPoints() const;
188 
189  //- Return insertSurfaceNearPointPairs Switch
190  inline Switch insertSurfaceNearPointPairs() const;
191 
192  //- Return the objOutput Switch
193  inline Switch objOutput() const;
194 
195  //- Return the meshedSurfaceOutput Switch
196  inline Switch meshedSurfaceOutput() const;
197 
198  //- Return the randomise initial point layout Switch
199  inline Switch randomiseInitialGrid() const;
200 
201  //- Return the random perturbation factor
202  inline scalar randomPerturbation() const;
203 
204  //- Return the maximum number of boundary conformation iterations
205  inline label maxBoundaryConformingIter() const;
206 
207  //- Return the span
208  inline scalar span() const;
209 
210  //- Return the span squared
211  inline scalar span2() const;
212 
213  //- Return the minEdgeLen
214  inline scalar minEdgeLen() const;
215 
216  //- Return the minEdgeLen squared
217  inline scalar minEdgeLen2() const;
218 
219  //- Return the maxNotchLen
220  inline scalar maxNotchLen() const;
221 
222  //- Return the maxNotchLen squared
223  inline scalar maxNotchLen2() const;
224 
225  //- Return the minNearPointDist
226  inline scalar minNearPointDist() const;
227 
228  //- Return the minNearPointDist squared
229  inline scalar minNearPointDist2() const;
230 
231  //- Return the ppDist
232  inline scalar ppDist() const;
233 
234 
235  // Write
236 
237  //- Write controls to output stream.
238  void write(Ostream& os) const;
239 
240  //- Ostream Operator
241  friend Ostream& operator<<
242  (
243  Ostream& os,
244  const cv2DControls& s
245  );
246 
247 
248  // Member Operators
249 
250  //- Disallow default bitwise assignment
251  void operator=(const cv2DControls&) = delete;
252 };
253 
254 
255 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
256 
257 } // End namespace Foam
258 
259 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
260 
261 #include "cv2DControlsI.H"
262 
263 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
264 
265 #endif
266 
267 // ************************************************************************* //
Switch mirrorPoints_
Mirror near-boundary points rather than insert point-pairs.
Definition: cv2DControls.H:95
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 minCellSize_
Minimum cell size below which protusions through the surface are.
Definition: cv2DControls.H:76
Switch insertSurfaceNearPointPairs_
Insert point-pairs vor dual-cell vertices very near the surface.
Definition: cv2DControls.H:98
runTime controlDict().lookup("adjustTimeStep") >> adjustTimeStep
scalar randomPerturbation_
Definition: cv2DControls.H:106
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
scalar maxNotchLen() const
Return the maxNotchLen.
scalar maxNotchLen2_
Square of maxNotchLen.
Definition: cv2DControls.H:131
Switch objOutput() const
Return the objOutput Switch.
Definition: cv2DControlsI.H:74
scalar span() const
Return the span.
scalar maxNotchLen2() const
Return the maxNotchLen squared.
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 nearWallAlignedDist2() const
Return square of nearWallAlignedDist.
Definition: cv2DControlsI.H:50
scalar nearWallAlignedDist2_
Square of nearWallAlignedDist.
Definition: cv2DControls.H:89
A bounding box defined in terms of the points at its extremities.
Definition: boundBox.H:58
scalar ppDist2_
Square of ppDist.
Definition: cv2DControls.H:144
~cv2DControls()
Destructor.
scalar minNearPointDist2() const
Return the minNearPointDist squared.
scalar nearWallAlignedDist_
Near-wall region where cells are aligned with the wall.
Definition: cv2DControls.H:86
Switch meshedSurfaceOutput() const
Return the meshedSurfaceOutput Switch.
Definition: cv2DControlsI.H:80
Switch insertSurfaceNearestPointPairs_
Insert near-boundary point mirror or point-pairs.
Definition: cv2DControls.H:92
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
void operator=(const cv2DControls &)=delete
Disallow default bitwise assignment.
label maxBoundaryConformingIter_
Definition: cv2DControls.H:108
scalar minNearPointDist() const
Return the minNearPointDist.
void write(Ostream &os) const
Write controls to output stream.
scalar ppDist_
Distance between boundary conforming point-pairs.
Definition: cv2DControls.H:141
Switch randomiseInitialGrid_
Definition: cv2DControls.H:104
scalar maxQuadAngle_
Maximum quadrant angle allowed at a concave corner before.
Definition: cv2DControls.H:83
scalar ppDist() const
Return the ppDist.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
label maxBoundaryConformingIter() const
Return the maximum number of boundary conformation iterations.
Definition: cv2DControlsI.H:98
scalar span2_
Square of span.
Definition: cv2DControls.H:117
scalar minCellSize2() const
Return the square of the minimum cell size.
Definition: cv2DControlsI.H:32
cv2DControls(const dictionary &controlDict, const boundBox &bb)
scalar minNearPointDist_
The minimum distance allowed between a dual-cell vertex.
Definition: cv2DControls.H:135
scalar minEdgeLen2_
Square of minEdgeLen.
Definition: cv2DControls.H:124
scalar span_
Maximum cartesian span of the geometry.
Definition: cv2DControls.H:114
scalar maxQuadAngle() const
Return the maximum quadrant angle.
Definition: cv2DControlsI.H:38
scalar minEdgeLen2() const
Return the minEdgeLen squared.
Controls for the 2D CV mesh generator.
Definition: cv2DControls.H:58
scalar minNearPointDist2_
Square of minNearPoint.
Definition: cv2DControls.H:138
Switch mirrorPoints() const
Return mirrorPoints Switch.
Definition: cv2DControlsI.H:62
scalar minCellSize2_
Square of minCellSize.
Definition: cv2DControls.H:79
Ostream & operator<<(Ostream &, const ensightPart &)
Switch insertSurfaceNearPointPairs() const
Return insertSurfaceNearPointPairs Switch.
Definition: cv2DControlsI.H:68
scalar minCellSize() const
Return the minimum cell size.
Definition: cv2DControlsI.H:26
scalar minEdgeLen_
Minimum edge-length of the cell size below which protusions.
Definition: cv2DControls.H:121
scalar minEdgeLen() const
Return the minEdgeLen.
scalar span2() const
Return the span squared.
Switch insertSurfaceNearestPointPairs() const
Return insertSurfaceNearestPointPairs Switch.
Definition: cv2DControlsI.H:56
Switch randomiseInitialGrid() const
Return the randomise initial point layout Switch.
Definition: cv2DControlsI.H:86
scalar randomPerturbation() const
Return the random perturbation factor.
Definition: cv2DControlsI.H:92
scalar nearWallAlignedDist() const
Return number of layers to align with the nearest wall.
Definition: cv2DControlsI.H:44
Switch meshedSurfaceOutput_
Definition: cv2DControls.H:102
scalar maxNotchLen_
Maximum notch size below which protusions into the surface are.
Definition: cv2DControls.H:128
Namespace for OpenFOAM.