Loading...
Searching...
No Matches
wallPoints.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) 2018-2020,2022 OpenCFD Ltd.
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::wallPoints
28
29Description
30 For use with FaceCellWave. Determines topological distance to starting faces
31
32SourceFiles
33 wallPointsI.H
34 wallPoints.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef wallPoints_H
39#define wallPoints_H
40
41#include "point.H"
42#include "tensor.H"
43#include "DynamicList.H"
44#include "labelList.H"
45#include "scalarList.H"
46#include "bitSet.H"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
52
53// Forward Declarations
54class polyPatch;
55class polyMesh;
56class wallPoints;
60/*---------------------------------------------------------------------------*\
61 Class wallPoints Declaration
62\*---------------------------------------------------------------------------*/
63
64class wallPoints
65{
66public:
67
68 //- Class used to pass additional data in
69 class trackData
70 {
71 public:
72
73 //- Per face whether the face should not be walked through
75
76 //- Per surface, per region the blockSize
80 (
81 const bitSet& isBlockedFace,
82 const List<scalarList>& regionToBlockSize
83 )
84 :
86 regionToBlockSize_(regionToBlockSize)
87 {}
88 };
89
90
91protected:
92
93 // Protected Data
94
95 //- Starting points
97
98 //- Distance (squared) from cellcenter to origin
100
101 //- Originating surface,region and topological region
103
104 //- Originating normal
105 //DynamicList<vector> normal_;
106
107
108 // Protected Member Functions
110 //- Evaluate distance to point.
111 // Update distSqr, origin from whomever is nearer pt.
112 // \return true if w2 is closer to point, false otherwise.
113 template<class TrackingData>
114 inline bool update
115 (
116 const point& pt,
117 const label index1,
118 const wallPoints& w2,
119 const label index2,
120
121 const scalar tol,
122 TrackingData& td
123 );
124
125
126public:
127
128 // Constructors
129
130 //- Default construct
131 inline wallPoints();
132
133 //- Construct from count
134 inline wallPoints
135 (
136 const UList<point>& origin,
137 const UList<scalar>& distSqr,
139 //const UList<vector>& normal
140 );
141
142
143 // Member Functions
144
145 // Access
146
147 const List<point>& origin() const
148 {
149 return origin_;
150 }
151 const List<scalar>& distSqr() const
152 {
153 return distSqr_;
154 }
155
156 const List<FixedList<label, 3>>& surface() const
157 {
158 return surface_;
159 }
160
161 //const List<vector>& normal() const
162 //{
163 // return normal_;
164 //}
165
166
167 // Needed by FaceCellWave
169 //- Changed or contains original (invalid) value
170 template<class TrackingData>
171 inline bool valid(TrackingData& td) const;
172
173 //- Check for identical geometrical data (eg, cyclics checking)
174 template<class TrackingData>
175 inline bool sameGeometry
176 (
177 const polyMesh&,
178 const wallPoints&,
179 const scalar,
180 TrackingData& td
181 ) const;
182
183 //- Convert any absolute coordinates into relative to (patch)face
184 // centre
185 template<class TrackingData>
186 inline void leaveDomain
187 (
188 const polyMesh&,
189 const polyPatch&,
190 const label patchFacei,
191 const point& faceCentre,
192 TrackingData& td
193 );
194
195 //- Reverse of leaveDomain
196 template<class TrackingData>
197 inline void enterDomain
198 (
199 const polyMesh&,
200 const polyPatch&,
201 const label patchFacei,
202 const point& faceCentre,
203 TrackingData& td
204 );
205
206 //- Apply rotation matrix to any coordinates
207 template<class TrackingData>
208 inline void transform
209 (
210 const polyMesh&,
211 const tensor&,
212 TrackingData& td
213 );
214
215 //- Influence of neighbouring face.
216 template<class TrackingData>
217 inline bool updateCell
218 (
219 const polyMesh&,
220 const label thisCelli,
221 const label neighbourFacei,
222 const wallPoints& neighbourInfo,
223 const scalar tol,
224 TrackingData& td
225 );
226
227 //- Influence of neighbouring cell.
228 template<class TrackingData>
229 inline bool updateFace
230 (
231 const polyMesh&,
232 const label thisFacei,
233 const label neighbourCelli,
234 const wallPoints& neighbourInfo,
235 const scalar tol,
236 TrackingData& td
237 );
238
239 //- Influence of different value on same face.
240 template<class TrackingData>
241 inline bool updateFace
242 (
243 const polyMesh&,
244 const label thisFacei,
245 const wallPoints& neighbourInfo,
246 const scalar tol,
247 TrackingData& td
248 );
249
250 //- Test for equality, with TrackingData
251 template<class TrackingData>
252 inline bool equal(const wallPoints&, TrackingData&) const;
253
254 //- Interpolate between two values (lerp). Returns true if
255 //- causes changes. Not sure if needs to be specialised between
256 //- face and cell and what index is needed...
257 template<class TrackingData>
258 inline bool interpolate
259 (
260 const polyMesh&,
261 const point& pt,
262 const label i0,
263 const wallPoints& f0,
264 const label i1,
265 const wallPoints& f1,
266 const scalar weight,
267 const scalar tol,
268 TrackingData& td
269 );
270
271
272 // Member Operators
273
274 //- Test for equality
275 inline bool operator==(const wallPoints&) const;
276
277 //- Test for inequality
278 inline bool operator!=(const wallPoints&) const;
279
280
281 // IOstream Operators
282
283 friend Ostream& operator<<(Ostream&, const wallPoints&);
285};
286
287
288// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
289
290} // End namespace Foam
291
292// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
293
294#include "wallPointsI.H"
295
296// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
297
298#endif
299
300// ************************************************************************* //
#define w2
Definition blockCreate.C:28
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition DynamicList.H:68
A 1D vector of objects of type <T> with a fixed length <N>.
Definition FixedList.H:73
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition UList.H:89
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition bitSet.H:61
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
trackData(const bitSet &isBlockedFace, const List< scalarList > &regionToBlockSize)
Definition wallPoints.H:81
const bitSet & isBlockedFace_
Per face whether the face should not be walked through.
Definition wallPoints.H:73
const List< scalarList > & regionToBlockSize_
Per surface, per region the blockSize.
Definition wallPoints.H:78
For use with FaceCellWave. Determines topological distance to starting faces.
Definition wallPoints.H:60
bool operator==(const wallPoints &) const
Test for equality.
DynamicList< scalar > distSqr_
Distance (squared) from cellcenter to origin.
Definition wallPoints.H:104
void transform(const polyMesh &, const tensor &, TrackingData &td)
Apply rotation matrix to any coordinates.
bool equal(const wallPoints &, TrackingData &) const
Test for equality, with TrackingData.
bool updateCell(const polyMesh &, const label thisCelli, const label neighbourFacei, const wallPoints &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
const List< scalar > & distSqr() const
Definition wallPoints.H:168
bool operator!=(const wallPoints &) const
Test for inequality.
void enterDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Reverse of leaveDomain.
const List< point > & origin() const
Definition wallPoints.H:164
wallPoints()
Default construct.
Definition wallPointsI.H:83
bool sameGeometry(const polyMesh &, const wallPoints &, const scalar, TrackingData &td) const
Check for identical geometrical data (eg, cyclics checking).
friend Istream & operator>>(Istream &, wallPoints &)
friend Ostream & operator<<(Ostream &, const wallPoints &)
const List< FixedList< label, 3 > > & surface() const
Definition wallPoints.H:173
bool valid(TrackingData &td) const
Changed or contains original (invalid) value.
bool updateFace(const polyMesh &, const label thisFacei, const label neighbourCelli, const wallPoints &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
DynamicList< FixedList< label, 3 > > surface_
Originating surface,region and topological region.
Definition wallPoints.H:109
DynamicList< point > origin_
Starting points.
Definition wallPoints.H:99
void leaveDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Convert any absolute coordinates into relative to (patch)face.
bool interpolate(const polyMesh &, const point &pt, const label i0, const wallPoints &f0, const label i1, const wallPoints &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...
mesh update()
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
const bitSet isBlockedFace(intersectedFaces())
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