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_;
101 
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 
116 
117  scalar randomPerturbation_;
118 
120 
121 
122  // Tolerances
123 
124  //- Maximum cartesian span of the geometry
125  scalar span_;
126 
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_;
136 
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
149  scalar minNearPointDist2_;
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 
166 
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;
177 
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;
192 
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 // ************************************************************************* //
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:112
Foam::cv2DControls::span2_
scalar span2_
Square of span.
Definition: cv2DControls.H:127
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:86
Foam::cv2DControls::nearWallAlignedDist2
scalar nearWallAlignedDist2() const
Return square of nearWallAlignedDist.
Definition: cv2DControlsI.H:52
Foam::cv2DControls::maxNotchLen_
scalar maxNotchLen_
Definition: cv2DControls.H:138
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:99
Foam::cv2DControls::minCellSize2_
scalar minCellSize2_
Square of minCellSize.
Definition: cv2DControls.H:89
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:148
Foam::cv2DControls::minEdgeLen_
scalar minEdgeLen_
Definition: cv2DControls.H:131
Foam::cv2DControls::minNearPointDist_
scalar minNearPointDist_
Definition: cv2DControls.H:145
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:116
Foam::cv2DControls::maxQuadAngle_
scalar maxQuadAngle_
Definition: cv2DControls.H:93
Foam::cv2DControls::ppDist_
scalar ppDist_
Distance between boundary conforming point-pairs.
Definition: cv2DControls.H:151
Foam::cv2DControls::minEdgeLen2_
scalar minEdgeLen2_
Square of minEdgeLen.
Definition: cv2DControls.H:134
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:124
Foam::cv2DControls::maxNotchLen2_
scalar maxNotchLen2_
Square of maxNotchLen.
Definition: cv2DControls.H:141
Switch.H
Foam::cv2DControls::ppDist2_
scalar ppDist2_
Square of ppDist.
Definition: cv2DControls.H:154
Foam::cv2DControls::insertSurfaceNearPointPairs_
Switch insertSurfaceNearPointPairs_
Insert point-pairs vor dual-cell vertices very near the surface.
Definition: cv2DControls.H:108
Foam::cv2DControls::nearWallAlignedDist_
scalar nearWallAlignedDist_
Near-wall region where cells are aligned with the wall.
Definition: cv2DControls.H:96
Foam::cv2DControls::minNearPointDist
scalar minNearPointDist() const
Return the minNearPointDist.
Definition: cv2DControlsI.H:142
Foam::cv2DControls::maxBoundaryConformingIter_
label maxBoundaryConformingIter_
Definition: cv2DControls.H:118
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:105
Foam::cv2DControls::randomiseInitialGrid_
Switch randomiseInitialGrid_
Definition: cv2DControls.H:114
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
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:110
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:102
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