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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::cv2DControls
28
29Description
30 Controls for the 2D CV mesh generator.
31
32SourceFiles
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
47namespace Foam
48{
49
50// Forward declaration of friend functions and operators
51
52class cv2DControls;
55
56
57/*---------------------------------------------------------------------------*\
58 Class cv2DControls Declaration
59\*---------------------------------------------------------------------------*/
61class 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
81public:
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
98
99 //- Square of nearWallAlignedDist
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
117 scalar randomPerturbation_;
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
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
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// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:78
A bounding box defined in terms of min/max extrema points.
Definition: boundBox.H:64
Controls for the 2D CV mesh generator.
Definition: cv2DControls.H:61
Switch meshedSurfaceOutput_
Definition: cv2DControls.H:112
scalar span2() const
Return the span squared.
Switch objOutput() const
Return the objOutput Switch.
Definition: cv2DControlsI.H:76
Switch insertSurfaceNearPointPairs() const
Return insertSurfaceNearPointPairs Switch.
Definition: cv2DControlsI.H:70
scalar minEdgeLen2_
Square of minEdgeLen.
Definition: cv2DControls.H:134
Switch mirrorPoints_
Mirror near-boundary points rather than insert point-pairs.
Definition: cv2DControls.H:105
scalar minCellSize2_
Square of minCellSize.
Definition: cv2DControls.H:89
Switch randomiseInitialGrid_
Definition: cv2DControls.H:114
scalar maxNotchLen2_
Square of maxNotchLen.
Definition: cv2DControls.H:141
Switch mirrorPoints() const
Return mirrorPoints Switch.
Definition: cv2DControlsI.H:64
scalar span_
Maximum cartesian span of the geometry.
Definition: cv2DControls.H:124
scalar minEdgeLen() const
Return the minEdgeLen.
~cv2DControls()=default
Destructor.
scalar span2_
Square of span.
Definition: cv2DControls.H:127
scalar nearWallAlignedDist2() const
Return square of nearWallAlignedDist.
Definition: cv2DControlsI.H:52
scalar ppDist() const
Return the ppDist.
scalar nearWallAlignedDist() const
Return number of layers to align with the nearest wall.
Definition: cv2DControlsI.H:46
Switch insertSurfaceNearestPointPairs() const
Return insertSurfaceNearestPointPairs Switch.
Definition: cv2DControlsI.H:58
label maxBoundaryConformingIter() const
Return the maximum number of boundary conformation iterations.
scalar minCellSize2() const
Return the square of the minimum cell size.
Definition: cv2DControlsI.H:34
scalar minNearPointDist2_
Square of minNearPoint.
Definition: cv2DControls.H:148
scalar maxNotchLen2() const
Return the maxNotchLen squared.
scalar maxNotchLen() const
Return the maxNotchLen.
label maxBoundaryConformingIter_
Definition: cv2DControls.H:118
scalar minNearPointDist() const
Return the minNearPointDist.
scalar randomPerturbation() const
Return the random perturbation factor.
Definition: cv2DControlsI.H:94
void write(Ostream &os) const
Write controls to output stream.
scalar nearWallAlignedDist2_
Square of nearWallAlignedDist.
Definition: cv2DControls.H:99
scalar randomPerturbation_
Definition: cv2DControls.H:116
Switch randomiseInitialGrid() const
Return the randomise initial point layout Switch.
Definition: cv2DControlsI.H:88
scalar ppDist_
Distance between boundary conforming point-pairs.
Definition: cv2DControls.H:151
scalar ppDist2_
Square of ppDist.
Definition: cv2DControls.H:154
scalar maxQuadAngle() const
Return the maximum quadrant angle.
Definition: cv2DControlsI.H:40
scalar nearWallAlignedDist_
Near-wall region where cells are aligned with the wall.
Definition: cv2DControls.H:96
scalar minCellSize() const
Return the minimum cell size.
Definition: cv2DControlsI.H:28
scalar span() const
Return the span.
cv2DControls(const dictionary &controlDict, const boundBox &bb)
scalar minNearPointDist2() const
Return the minNearPointDist squared.
Switch meshedSurfaceOutput() const
Return the meshedSurfaceOutput Switch.
Definition: cv2DControlsI.H:82
scalar minEdgeLen2() const
Return the minEdgeLen squared.
Switch insertSurfaceNearestPointPairs_
Insert near-boundary point mirror or point-pairs.
Definition: cv2DControls.H:102
Switch insertSurfaceNearPointPairs_
Insert point-pairs vor dual-cell vertices very near the surface.
Definition: cv2DControls.H:108
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
runTime controlDict().readEntry("adjustTimeStep"
OBJstream os(runTime.globalPath()/outputName)
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))
Namespace for OpenFOAM.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
runTime write()