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