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