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;
57Istream& operator>>(Istream&, wallPoints&);
58Ostream& operator<<(Ostream&, const wallPoints&);
59
60/*---------------------------------------------------------------------------*\
61 Class wallPoints Declaration
62\*---------------------------------------------------------------------------*/
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 :
85 isBlockedFace_(isBlockedFace),
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
109
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
147 const List<point>& origin() const
148 {
149 return origin_;
151 const List<scalar>& distSqr() const
152 {
153 return distSqr_;
154 }
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
168
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
255 // Member Operators
256
257 //- Test for equality
258 inline bool operator==(const wallPoints&) const;
259
260 //- Test for inequality
261 inline bool operator!=(const wallPoints&) const;
262
263
264 // IOstream Operators
268};
269
270
271// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
272
273} // End namespace Foam
274
275// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
276
277#include "wallPointsI.H"
278
279// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
280
281#endif
282
283// ************************************************************************* //
#define w2
Definition: blockCreate.C:35
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:72
A 1D vector of objects of type <T> with a fixed length <N>.
Definition: FixedList.H:81
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
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:94
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:66
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
Class used to pass additional data in.
Definition: wallPoints.H:69
trackData(const bitSet &isBlockedFace, const List< scalarList > &regionToBlockSize)
Definition: wallPoints.H:79
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:76
For use with FaceCellWave. Determines topological distance to starting faces.
Definition: wallPoints.H:64
bool operator==(const wallPoints &) const
Test for equality.
Definition: wallPointsI.H:411
DynamicList< scalar > distSqr_
Distance (squared) from cellcenter to origin.
Definition: wallPoints.H:98
void transform(const polyMesh &, const tensor &, TrackingData &td)
Apply rotation matrix to any coordinates.
Definition: wallPointsI.H:158
bool equal(const wallPoints &, TrackingData &) const
Test for equality, with TrackingData.
Definition: wallPointsI.H:399
bool updateCell(const polyMesh &, const label thisCelli, const label neighbourFacei, const wallPoints &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
Definition: wallPointsI.H:193
const List< scalar > & distSqr() const
Definition: wallPoints.H:150
bool operator!=(const wallPoints &) const
Test for inequality.
Definition: wallPointsI.H:424
void enterDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Reverse of leaveDomain.
Definition: wallPointsI.H:174
const List< point > & origin() const
Definition: wallPoints.H:146
wallPoints()
Default construct.
Definition: wallPointsI.H:90
bool sameGeometry(const polyMesh &, const wallPoints &, const scalar, TrackingData &td) const
Check for identical geometrical data (eg, cyclics checking)
Definition: wallPointsI.H:126
friend Istream & operator>>(Istream &, wallPoints &)
friend Ostream & operator<<(Ostream &, const wallPoints &)
const List< FixedList< label, 3 > > & surface() const
Definition: wallPoints.H:155
bool valid(TrackingData &td) const
Changed or contains original (invalid) value.
Definition: wallPointsI.H:117
bool updateFace(const polyMesh &, const label thisFacei, const label neighbourCelli, const wallPoints &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
Definition: wallPointsI.H:263
DynamicList< FixedList< label, 3 > > surface_
Originating surface,region and topological region.
Definition: wallPoints.H:101
DynamicList< point > origin_
Starting points.
Definition: wallPoints.H:95
void leaveDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Convert any absolute coordinates into relative to (patch)face.
Definition: wallPointsI.H:140
mesh update()
Namespace for OpenFOAM.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Istream & operator>>(Istream &, directionInfo &)