Loading...
Searching...
No Matches
wallPoint.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-2016 OpenFOAM Foundation
9 Copyright (C) 2019-2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::wallPoint
29
30Description
31 Holds information regarding nearest wall point. Used in wall distance
32 calculation.
33
34SourceFiles
35 wallPointI.H
36 wallPoint.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef wallPoint_H
41#define wallPoint_H
42
43#include "point.H"
44#include "label.H"
45#include "scalar.H"
46#include "tensor.H"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
52
53// Forward Declarations
54class polyPatch;
55class polyMesh;
56class wallPoint;
57
60
62/*---------------------------------------------------------------------------*\
63 Class wallPoint Declaration
64\*---------------------------------------------------------------------------*/
65
66class wallPoint
67{
68 // Private Data
69
70 //- Position of nearest wall center
71 point origin_;
72
73 //- Normal distance (squared) from cellcenter to origin
74 scalar distSqr_;
75
76
77 // Private Member Functions
78
79 // Update this with w2 if distance less
80 template<class TrackingData>
81 inline bool update
82 (
83 const wallPoint& w2,
84 const scalar dist2,
85 const scalar tol,
86 TrackingData& td
87 );
88
89 //- Evaluate distance to point.
90 // Update distSqr, origin from whomever is nearer pt.
91 // \return true if w2 is closer to point, false otherwise.
92 template<class TrackingData>
93 inline bool update
94 (
95 const point&,
96 const wallPoint& w2,
97 const scalar tol,
98 TrackingData& td
99 );
100
101
102public:
103
104 // Constructors
105
106 //- Default construct
107 inline wallPoint();
108
109 //- Construct from origin, distance-squared
110 inline wallPoint(const point& origin, const scalar distSqr);
111
112
113 // Member Functions
114
115 // Access
116
117 const point& origin() const
118 {
119 return origin_;
120 }
121 point& origin()
122 {
123 return origin_;
124 }
125
126 scalar distSqr() const
128 return distSqr_;
129 }
130 scalar& distSqr()
131 {
132 return distSqr_;
133 }
134
135
136 // Needed by FaceCellWave
137
138 //- Changed or contains original (invalid) value
139 template<class TrackingData>
140 inline bool valid(TrackingData& td) const;
141
142 //- Check for identical geometrical data (eg, cyclics checking)
143 template<class TrackingData>
144 inline bool sameGeometry
145 (
146 const polyMesh&,
147 const wallPoint&,
148 const scalar,
149 TrackingData& td
150 ) const;
151
152 //- Convert any absolute coordinates into relative to (patch)face
153 //- centre
154 template<class TrackingData>
155 inline void leaveDomain
156 (
157 const polyMesh&,
158 const polyPatch&,
159 const label patchFacei,
160 const point& faceCentre,
161 TrackingData& td
162 );
163
164 //- Reverse of leaveDomain
165 template<class TrackingData>
166 inline void enterDomain
167 (
168 const polyMesh&,
169 const polyPatch&,
170 const label patchFacei,
171 const point& faceCentre,
172 TrackingData& td
173 );
174
175 //- Apply rotation matrix to any coordinates
176 template<class TrackingData>
177 inline void transform
178 (
179 const polyMesh&,
180 const tensor&,
181 TrackingData& td
182 );
183
184 //- Influence of neighbouring face.
185 template<class TrackingData>
186 inline bool updateCell
187 (
188 const polyMesh&,
189 const label thisCelli,
190 const label neighbourFacei,
191 const wallPoint& neighbourInfo,
192 const scalar tol,
193 TrackingData& td
194 );
195
196 //- Influence of neighbouring cell.
197 template<class TrackingData>
198 inline bool updateFace
199 (
200 const polyMesh&,
201 const label thisFacei,
202 const label neighbourCelli,
203 const wallPoint& neighbourInfo,
204 const scalar tol,
205 TrackingData& td
206 );
207
208 //- Influence of different value on same face.
209 template<class TrackingData>
210 inline bool updateFace
211 (
212 const polyMesh&,
213 const label thisFacei,
214 const wallPoint& neighbourInfo,
215 const scalar tol,
216 TrackingData& td
217 );
218
219 //- Interpolate different values
220 template<class TrackingData>
222 (
223 const polyMesh&,
224 const scalar weight,
225 const label face0,
226 const wallPoint& info0,
227 const label face1,
228 const wallPoint& info1,
229 const scalar tol,
230 TrackingData& td
231 );
232
233 //- Test for equality, with TrackingData
234 template<class TrackingData>
235 inline bool equal(const wallPoint&, TrackingData& td) const;
236
237 //- Interpolate between two values (lerp). Returns true if
238 //- causes changes. Not sure if needs to be specialised between
239 //- face and cell and what index is needed...
240 template<class TrackingData>
241 inline bool interpolate
242 (
243 const polyMesh&,
244 const point& pt,
245 const label i0,
246 const wallPoint& f0,
247 const label i1,
248 const wallPoint& f1,
249 const scalar weight,
250 const scalar tol,
251 TrackingData& td
252 );
253
254
255 // Member Operators
256
257 //- Test for equality
258 inline bool operator==(const wallPoint&) const;
259
260 //- Test for inequality
261 inline bool operator!=(const wallPoint&) const;
262
263
264 // IOstream Operators
265
266 friend Ostream& operator<<(Ostream&, const wallPoint&);
268};
269
270
271// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
272
273//- Contiguous data for wallPoint
274template<> struct is_contiguous<wallPoint> : std::true_type {};
275
276//- Contiguous scalar data for wallPoint
277template<> struct is_contiguous_scalar<wallPoint> : std::true_type {};
278
279
280// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
281
282} // End namespace Foam
283
284// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
285
286#include "wallPointI.H"
287
288// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
289
290#endif
291
292// ************************************************************************* //
#define w2
Definition blockCreate.C:28
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
A patch is a list of labels that address the faces in the global face list.
Definition polyPatch.H:73
Holds information regarding nearest wall point. Used in wall distance calculation.
Definition wallPoint.H:62
const point & origin() const
Definition wallPoint.H:123
scalar & distSqr()
Definition wallPoint.H:136
friend Ostream & operator<<(Ostream &, const wallPoint &)
bool operator!=(const wallPoint &) const
Test for inequality.
Definition wallPointI.H:331
void transform(const polyMesh &, const tensor &, TrackingData &td)
Apply rotation matrix to any coordinates.
Definition wallPointI.H:161
point & origin()
Definition wallPoint.H:127
void enterDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Reverse of leaveDomain.
Definition wallPointI.H:175
bool operator==(const wallPoint &) const
Test for equality.
Definition wallPointI.H:322
bool equal(const wallPoint &, TrackingData &td) const
Test for equality, with TrackingData.
Definition wallPointI.H:258
scalar distSqr() const
Definition wallPoint.H:132
bool interpolate(const polyMesh &, const point &pt, const label i0, const wallPoint &f0, const label i1, const wallPoint &f1, const scalar weight, const scalar tol, TrackingData &td)
Interpolate between two values (lerp). Returns true if causes changes. Not sure if needs to be specia...
Definition wallPointI.H:269
bool updateCell(const polyMesh &, const label thisCelli, const label neighbourFacei, const wallPoint &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
Definition wallPointI.H:191
bool sameGeometry(const polyMesh &, const wallPoint &, const scalar, TrackingData &td) const
Check for identical geometrical data (eg, cyclics checking).
Definition wallPointI.H:118
wallPoint()
Default construct.
Definition wallPointI.H:92
bool valid(TrackingData &td) const
Changed or contains original (invalid) value.
Definition wallPointI.H:109
wallPoint(const polyMesh &, const scalar weight, const label face0, const wallPoint &info0, const label face1, const wallPoint &info1, const scalar tol, TrackingData &td)
Interpolate different values.
bool updateFace(const polyMesh &, const label thisFacei, const label neighbourCelli, const wallPoint &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
Definition wallPointI.H:214
void leaveDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Convert any absolute coordinates into relative to (patch)face centre.
Definition wallPointI.H:147
friend Istream & operator>>(Istream &, wallPoint &)
mesh update()
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
Namespace for OpenFOAM.
Tensor< scalar > tensor
Definition symmTensor.H:57
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
Istream & operator>>(Istream &, directionInfo &)
vector point
Point is a vector.
Definition point.H:37
A template class to specify if a data type is composed solely of Foam::scalar elements.
Definition contiguous.H:87
A template class to specify that a data type can be considered as being contiguous in memory.
Definition contiguous.H:70