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