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