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  const dictionary& motionControl_;
64 
65  const dictionary& conformationControl_;
66 
67 
68 public:
69 
70  // Controls
71 
72  //- Minimum cell size below which protrusions through the surface
73  // are not split
74  scalar minCellSize_;
75 
76  //- Square of minCellSize
77  scalar minCellSize2_;
78 
79  //- Maximum quadrant angle allowed at a concave corner before
80  // additional "mitering" lines are added
81  scalar maxQuadAngle_;
82 
83  //- Near-wall region where cells are aligned with the wall
84  scalar nearWallAlignedDist_;
85 
86  //- Square of nearWallAlignedDist
87  scalar nearWallAlignedDist2_;
88 
89  //- Insert near-boundary point mirror or point-pairs
91 
92  //- Mirror near-boundary points rather than insert point-pairs
94 
95  //- Insert point-pairs vor dual-cell vertices very near the surface
97 
99 
104  scalar randomPerturbation_;
107 
108 
109  // Tolerances
110 
111  //- Maximum cartesian span of the geometry
112  scalar span_;
113 
114  //- Square of span
115  scalar span2_;
116 
117  //- Minimum edge-length of the cell size below which protrusions
118  // through the surface are not split
119  scalar minEdgeLen_;
120 
121  //- Square of minEdgeLen
122  scalar minEdgeLen2_;
123 
124  //- Maximum notch size below which protrusions into the surface are
125  // not filled
126  scalar maxNotchLen_;
127 
128  //- Square of maxNotchLen
129  scalar maxNotchLen2_;
130 
131  //- The minimum distance allowed between a dual-cell vertex
132  // and the surface before a point-pair is introduced
133  scalar minNearPointDist_;
134 
135  //- Square of minNearPoint
136  scalar minNearPointDist2_;
137 
138  //- Distance between boundary conforming point-pairs
139  scalar ppDist_;
140 
141  //- Square of ppDist
142  scalar ppDist2_;
143 
144 
145  // Constructors
146 
148  (
149  const dictionary& controlDict,
150  const boundBox& bb
151  );
152 
153  //- Disallow default bitwise copy construction
154  cv2DControls(const cv2DControls&) = delete;
155 
156 
157  //- Destructor
158  ~cv2DControls();
159 
160 
161  // Member Functions
162 
163  // Access
164 
165  //- Return the minimum cell size
166  inline scalar minCellSize() const;
167 
168  //- Return the square of the minimum cell size
169  inline scalar minCellSize2() const;
170 
171  //- Return the maximum quadrant angle
172  inline scalar maxQuadAngle() const;
173 
174  //- Return number of layers to align with the nearest wall
175  inline scalar nearWallAlignedDist() const;
176 
177  //- Return square of nearWallAlignedDist
178  inline scalar nearWallAlignedDist2() const;
179 
180  //- Return insertSurfaceNearestPointPairs Switch
181  inline Switch insertSurfaceNearestPointPairs() const;
182 
183  //- Return mirrorPoints Switch
184  inline Switch mirrorPoints() const;
185 
186  //- Return insertSurfaceNearPointPairs Switch
187  inline Switch insertSurfaceNearPointPairs() const;
188 
189  //- Return the objOutput Switch
190  inline Switch objOutput() const;
191 
192  //- Return the meshedSurfaceOutput Switch
193  inline Switch meshedSurfaceOutput() const;
194 
195  //- Return the randomise initial point layout Switch
196  inline Switch randomiseInitialGrid() const;
197 
198  //- Return the random perturbation factor
199  inline scalar randomPerturbation() const;
200 
201  //- Return the maximum number of boundary conformation iterations
202  inline label maxBoundaryConformingIter() const;
203 
204  //- Return the span
205  inline scalar span() const;
206 
207  //- Return the span squared
208  inline scalar span2() const;
209 
210  //- Return the minEdgeLen
211  inline scalar minEdgeLen() const;
212 
213  //- Return the minEdgeLen squared
214  inline scalar minEdgeLen2() const;
215 
216  //- Return the maxNotchLen
217  inline scalar maxNotchLen() const;
218 
219  //- Return the maxNotchLen squared
220  inline scalar maxNotchLen2() const;
221 
222  //- Return the minNearPointDist
223  inline scalar minNearPointDist() const;
224 
225  //- Return the minNearPointDist squared
226  inline scalar minNearPointDist2() const;
227 
228  //- Return the ppDist
229  inline scalar ppDist() const;
230 
231 
232  // Write
233 
234  //- Write controls to output stream.
235  void write(Ostream& os) const;
236 
237  //- Ostream Operator
238  friend Ostream& operator<<
239  (
240  Ostream& os,
241  const cv2DControls& s
242  );
243 
244 
245  // Member Operators
246 
247  //- Disallow default bitwise assignment
248  void operator=(const cv2DControls&) = delete;
249 };
250 
251 
252 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
253 
254 } // End namespace Foam
255 
256 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
257 
258 #include "cv2DControlsI.H"
259 
260 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
261 
262 #endif
263 
264 // ************************************************************************* //
Switch mirrorPoints_
Mirror near-boundary points rather than insert point-pairs.
Definition: cv2DControls.H:92
scalar minCellSize_
Minimum cell size below which protrusions through the surface.
Definition: cv2DControls.H:73
Switch insertSurfaceNearPointPairs_
Insert point-pairs vor dual-cell vertices very near the surface.
Definition: cv2DControls.H:95
runTime controlDict().lookup("adjustTimeStep") >> adjustTimeStep
scalar randomPerturbation_
Definition: cv2DControls.H:103
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
scalar maxNotchLen() const
Return the maxNotchLen.
scalar maxNotchLen2_
Square of maxNotchLen.
Definition: cv2DControls.H:128
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:86
A bounding box defined in terms of the points at its extremities.
Definition: boundBox.H:58
scalar ppDist2_
Square of ppDist.
Definition: cv2DControls.H:141
~cv2DControls()
Destructor.
scalar minNearPointDist2() const
Return the minNearPointDist squared.
scalar nearWallAlignedDist_
Near-wall region where cells are aligned with the wall.
Definition: cv2DControls.H:83
Switch meshedSurfaceOutput() const
Return the meshedSurfaceOutput Switch.
Definition: cv2DControlsI.H:80
Switch insertSurfaceNearestPointPairs_
Insert near-boundary point mirror or point-pairs.
Definition: cv2DControls.H:89
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:105
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:138
Switch randomiseInitialGrid_
Definition: cv2DControls.H:101
scalar maxQuadAngle_
Maximum quadrant angle allowed at a concave corner before.
Definition: cv2DControls.H:80
scalar ppDist() const
Return the ppDist.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
label maxBoundaryConformingIter() const
Return the maximum number of boundary conformation iterations.
Definition: cv2DControlsI.H:98
scalar span2_
Square of span.
Definition: cv2DControls.H:114
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:132
scalar minEdgeLen2_
Square of minEdgeLen.
Definition: cv2DControls.H:121
scalar span_
Maximum cartesian span of the geometry.
Definition: cv2DControls.H:111
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:135
Switch mirrorPoints() const
Return mirrorPoints Switch.
Definition: cv2DControlsI.H:62
scalar minCellSize2_
Square of minCellSize.
Definition: cv2DControls.H:76
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 protrusions.
Definition: cv2DControls.H:118
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:99
scalar maxNotchLen_
Maximum notch size below which protrusions into the surface are.
Definition: cv2DControls.H:125
Namespace for OpenFOAM.