snapParameters.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-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::snapParameters
26 
27 Description
28  Simple container to keep together snap specific information.
29 
30 SourceFiles
31  snapParameters.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef snapParameters_H
36 #define snapParameters_H
37 
38 #include "dictionary.H"
39 #include "scalar.H"
40 #include "Switch.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class snapParameters Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class snapParameters
52 {
53  // Private data
54 
55  const label nSmoothPatch_;
56 
57  const label nSmoothInternal_;
58 
59  const scalar snapTol_;
60 
61  const label nSmoothDispl_;
62 
63  const label nSnap_;
64 
65  const label nFeatureSnap_;
66 
68 
70 
72 
74 
76 
77  const Switch detectBaffles_;
78 
80 
81  const Switch releasePoints_;
82 
83  const Switch stringFeatures_;
84 
85  const Switch avoidDiagonal_;
86 
87 
88  //- How often needs face splitting be run
90 
91  //- When is angle too concave too split
92  scalar concaveAngle_;
93 
94  //- When is face-split not sufficiently diagonal
95  scalar minAreaRatio_;
96 
97 
98  // Private Member Functions
99 
100  //- Disallow default bitwise copy construct
102 
103  //- Disallow default bitwise assignment
104  void operator=(const snapParameters&);
105 
106 
107 public:
108 
109  // Constructors
110 
111  //- Construct from dictionary
113 
114 
115  // Member Functions
116 
117  // Access
118 
119  //- Number of patch smoothing iterations before finding
120  // correspondence to surface
121  label nSmoothPatch() const
122  {
123  return nSmoothPatch_;
124  }
125 
126  //- Number of internal point smoothing iterations (combined with
127  // nSmoothPatch
128  label nSmoothInternal() const
129  {
130  return nSmoothInternal_;
131  }
132 
133  //- Relative distance for points to be attracted by surface
134  // feature point
135  // or edge. True distance is this factor times local
136  // maximum edge length.
137  scalar snapTol() const
138  {
139  return snapTol_;
140  }
141 
142  //- Number of mesh displacement smoothing iterations.
143  label nSmoothDispl() const
144  {
145  return nSmoothDispl_;
146  }
147 
148  //- Maximum number of snapping relaxation iterations. Should stop
149  // before upon reaching a correct mesh.
150  label nSnap() const
151  {
152  return nSnap_;
153  }
154 
155 
156  // Surface snapping specific
157 
158  //- Override attraction to nearest with intersection location
159  // at near surfaces
161  {
163  }
164 
165  //- Attract point to corresponding surface region only
166  Switch strictRegionSnap() const
167  {
168  return strictRegionSnap_;
169  }
170 
171 
172  // Feature edge snapping specific
173 
174  label nFeatureSnap() const
175  {
176  return nFeatureSnap_;
177  }
178 
180  {
181  return explicitFeatureSnap_;
182  }
183 
185  {
186  return implicitFeatureSnap_;
187  }
188 
190  {
192  }
193 
194  Switch detectBaffles() const
195  {
196  return detectBaffles_;
197  }
198 
200  {
201  return baffleFeaturePoints_;
202  }
203 
204  Switch releasePoints() const
205  {
206  return releasePoints_;
207  }
208 
209  Switch stringFeatures() const
210  {
211  return stringFeatures_;
212  }
213 
214  Switch avoidDiagonal() const
215  {
216  return avoidDiagonal_;
217  }
218 
219 
220  // Face splitting
221 
222  label nFaceSplitInterval() const
223  {
224  return nFaceSplitInterval_;
225  }
226 
227  scalar concaveAngle() const
228  {
229  return concaveAngle_;
230  }
231 
232  scalar minAreaRatio() const
233  {
234  return minAreaRatio_;
235  }
236 
237 
238 
239 
240 };
241 
242 
243 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
244 
245 } // End namespace Foam
246 
247 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
248 
249 #endif
250 
251 // ************************************************************************* //
Foam::snapParameters::avoidDiagonal
Switch avoidDiagonal() const
Definition: snapParameters.H:213
Foam::snapParameters::minAreaRatio
scalar minAreaRatio() const
Definition: snapParameters.H:231
Foam::snapParameters::detectBaffles
Switch detectBaffles() const
Definition: snapParameters.H:193
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::snapParameters::detectBaffles_
const Switch detectBaffles_
Definition: snapParameters.H:76
Foam::snapParameters::minAreaRatio_
scalar minAreaRatio_
When is face-split not sufficiently diagonal.
Definition: snapParameters.H:94
Foam::snapParameters::stringFeatures_
const Switch stringFeatures_
Definition: snapParameters.H:82
Foam::snapParameters::nSnap_
const label nSnap_
Definition: snapParameters.H:62
Foam::snapParameters::strictRegionSnap_
const Switch strictRegionSnap_
Definition: snapParameters.H:74
Foam::snapParameters::nSmoothDispl_
const label nSmoothDispl_
Definition: snapParameters.H:60
Foam::snapParameters::snapTol_
const scalar snapTol_
Definition: snapParameters.H:58
Foam::snapParameters::baffleFeaturePoints
Switch baffleFeaturePoints() const
Definition: snapParameters.H:198
Foam::snapParameters::explicitFeatureSnap
Switch explicitFeatureSnap() const
Definition: snapParameters.H:178
Foam::snapParameters::implicitFeatureSnap
Switch implicitFeatureSnap() const
Definition: snapParameters.H:183
Foam::snapParameters::releasePoints
Switch releasePoints() const
Definition: snapParameters.H:203
Foam::snapParameters
Simple container to keep together snap specific information.
Definition: snapParameters.H:50
Foam::snapParameters::nFeatureSnap
label nFeatureSnap() const
Definition: snapParameters.H:173
Foam::snapParameters::multiRegionFeatureSnap_
const Switch multiRegionFeatureSnap_
Definition: snapParameters.H:70
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::snapParameters::nSmoothInternal_
const label nSmoothInternal_
Definition: snapParameters.H:56
Foam::snapParameters::stringFeatures
Switch stringFeatures() const
Definition: snapParameters.H:208
Foam::snapParameters::detectNearSurfacesSnap_
const Switch detectNearSurfacesSnap_
Definition: snapParameters.H:72
Foam::snapParameters::strictRegionSnap
Switch strictRegionSnap() const
Attract point to corresponding surface region only.
Definition: snapParameters.H:165
Switch.H
Foam::snapParameters::concaveAngle
scalar concaveAngle() const
Definition: snapParameters.H:226
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::snapParameters::nSnap
label nSnap() const
Maximum number of snapping relaxation iterations. Should stop.
Definition: snapParameters.H:149
Foam::snapParameters::concaveAngle_
scalar concaveAngle_
When is angle too concave too split.
Definition: snapParameters.H:91
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
scalar.H
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::snapParameters::nFaceSplitInterval_
label nFaceSplitInterval_
How often needs face splitting be run.
Definition: snapParameters.H:88
Foam::snapParameters::nFeatureSnap_
const label nFeatureSnap_
Definition: snapParameters.H:64
Foam::snapParameters::operator=
void operator=(const snapParameters &)
Disallow default bitwise assignment.
Foam::snapParameters::releasePoints_
const Switch releasePoints_
Definition: snapParameters.H:80
Foam::snapParameters::avoidDiagonal_
const Switch avoidDiagonal_
Definition: snapParameters.H:84
Foam::snapParameters::nSmoothPatch_
const label nSmoothPatch_
Definition: snapParameters.H:54
Foam::snapParameters::snapTol
scalar snapTol() const
Relative distance for points to be attracted by surface.
Definition: snapParameters.H:136
Foam::snapParameters::nFaceSplitInterval
label nFaceSplitInterval() const
Definition: snapParameters.H:221
Foam::snapParameters::nSmoothInternal
label nSmoothInternal() const
Number of internal point smoothing iterations (combined with.
Definition: snapParameters.H:127
Foam::snapParameters::explicitFeatureSnap_
const Switch explicitFeatureSnap_
Definition: snapParameters.H:66
Foam::snapParameters::detectNearSurfacesSnap
Switch detectNearSurfacesSnap() const
Override attraction to nearest with intersection location.
Definition: snapParameters.H:159
Foam::snapParameters::baffleFeaturePoints_
const Switch baffleFeaturePoints_
Definition: snapParameters.H:78
Foam::snapParameters::snapParameters
snapParameters(const snapParameters &)
Disallow default bitwise copy construct.
dictionary.H
Foam::snapParameters::nSmoothDispl
label nSmoothDispl() const
Number of mesh displacement smoothing iterations.
Definition: snapParameters.H:142
Foam::snapParameters::implicitFeatureSnap_
const Switch implicitFeatureSnap_
Definition: snapParameters.H:68
Foam::snapParameters::nSmoothPatch
label nSmoothPatch() const
Number of patch smoothing iterations before finding.
Definition: snapParameters.H:120
Foam::snapParameters::multiRegionFeatureSnap
Switch multiRegionFeatureSnap() const
Definition: snapParameters.H:188