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