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 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::wallPoints
28 
29 Description
30  For use with FaceCellWave. Determines topological distance to starting faces
31 
32 SourceFiles
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 "bitSet.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 // Forward Declarations
53 class polyPatch;
54 class polyMesh;
55 class wallPoints;
56 Istream& operator>>(Istream&, wallPoints&);
57 Ostream& operator<<(Ostream&, const wallPoints&);
58 
59 /*---------------------------------------------------------------------------*\
60  Class wallPoints Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 class wallPoints
64 {
65 public:
66 
67  //- Class used to pass additional data in
68  class trackData
69  {
70  public:
71 
72  //- Per face whether the face should not be walked through
73  const bitSet& isBlockedFace_;
74 
75  trackData(const bitSet& isBlockedFace)
76  :
77  isBlockedFace_(isBlockedFace)
78  {}
79  };
80 
81 
82 protected:
83 
84  // Protected Data
85 
86  //- Starting points
88 
89  //- Distance (squared) from cellcenter to origin
91 
92  //- Originating surface,region and topological region
94 
95  //- Originating normal
96  //DynamicList<vector> normal_;
97 
98 
99  // Protected Member Functions
100 
101  //- Evaluate distance to point.
102  // Update distSqr, origin from whomever is nearer pt.
103  // \return true if w2 is closer to point, false otherwise.
104  template<class TrackingData>
105  inline bool update
106  (
107  const point& pt,
108  const label index1,
109  const wallPoints& w2,
110  const label index2,
111 
112  const scalar tol,
113  TrackingData& td
114  );
115 
116 
117 public:
118 
119  // Constructors
120 
121  //- Default construct
122  inline wallPoints();
123 
124  //- Construct from count
125  inline wallPoints
126  (
127  const UList<point>& origin,
128  const UList<scalar>& distSqr,
130  //const UList<vector>& normal
131  );
132 
133 
134  // Member Functions
135 
136  // Access
137 
138  const List<point>& origin() const
139  {
140  return origin_;
141  }
142  const List<scalar>& distSqr() const
143  {
144  return distSqr_;
145  }
146 
147  const List<FixedList<label, 3>>& surface() const
148  {
149  return surface_;
150  }
151 
152  //const List<vector>& normal() const
153  //{
154  // return normal_;
155  //}
156 
157 
158  // Needed by FaceCellWave
159 
160  //- Changed or contains original (invalid) value
161  template<class TrackingData>
162  inline bool valid(TrackingData& td) const;
163 
164  //- Check for identical geometrical data (eg, cyclics checking)
165  template<class TrackingData>
166  inline bool sameGeometry
167  (
168  const polyMesh&,
169  const wallPoints&,
170  const scalar,
171  TrackingData& td
172  ) const;
173 
174  //- Convert any absolute coordinates into relative to (patch)face
175  // centre
176  template<class TrackingData>
177  inline void leaveDomain
178  (
179  const polyMesh&,
180  const polyPatch&,
181  const label patchFacei,
182  const point& faceCentre,
183  TrackingData& td
184  );
185 
186  //- Reverse of leaveDomain
187  template<class TrackingData>
188  inline void enterDomain
189  (
190  const polyMesh&,
191  const polyPatch&,
192  const label patchFacei,
193  const point& faceCentre,
194  TrackingData& td
195  );
196 
197  //- Apply rotation matrix to any coordinates
198  template<class TrackingData>
199  inline void transform
200  (
201  const polyMesh&,
202  const tensor&,
203  TrackingData& td
204  );
205 
206  //- Influence of neighbouring face.
207  template<class TrackingData>
208  inline bool updateCell
209  (
210  const polyMesh&,
211  const label thisCelli,
212  const label neighbourFacei,
213  const wallPoints& neighbourInfo,
214  const scalar tol,
215  TrackingData& td
216  );
217 
218  //- Influence of neighbouring cell.
219  template<class TrackingData>
220  inline bool updateFace
221  (
222  const polyMesh&,
223  const label thisFacei,
224  const label neighbourCelli,
225  const wallPoints& neighbourInfo,
226  const scalar tol,
227  TrackingData& td
228  );
229 
230  //- Influence of different value on same face.
231  template<class TrackingData>
232  inline bool updateFace
233  (
234  const polyMesh&,
235  const label thisFacei,
236  const wallPoints& neighbourInfo,
237  const scalar tol,
238  TrackingData& td
239  );
240 
241  //- Test for equality, with TrackingData
242  template<class TrackingData>
243  inline bool equal(const wallPoints&, TrackingData&) const;
244 
245 
246  // Member Operators
247 
248  //- Test for equality
249  inline bool operator==(const wallPoints&) const;
250 
251  //- Test for inequality
252  inline bool operator!=(const wallPoints&) const;
253 
254 
255  // IOstream Operators
256 
257  friend Ostream& operator<<(Ostream&, const wallPoints&);
258  friend Istream& operator>>(Istream&, wallPoints&);
259 };
260 
261 
262 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
263 
264 } // End namespace Foam
265 
266 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
267 
268 #include "wallPointsI.H"
269 
270 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
271 
272 #endif
273 
274 // ************************************************************************* //
Foam::wallPoints::distSqr_
DynamicList< scalar > distSqr_
Distance (squared) from cellcenter to origin.
Definition: wallPoints.H:89
Foam::Tensor< scalar >
Foam::wallPoints::valid
bool valid(TrackingData &td) const
Changed or contains original (invalid) value.
Definition: wallPointsI.H:117
Foam::wallPoints::transform
void transform(const polyMesh &, const tensor &, TrackingData &td)
Apply rotation matrix to any coordinates.
Definition: wallPointsI.H:158
Foam::bitSet
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:63
Foam::wallPoints::operator!=
bool operator!=(const wallPoints &) const
Test for inequality.
Definition: wallPointsI.H:352
Foam::DynamicList< point >
Foam::wallPoints::operator>>
friend Istream & operator>>(Istream &, wallPoints &)
Foam::wallPoints::origin_
DynamicList< point > origin_
Starting points.
Definition: wallPoints.H:86
point.H
Foam::wallPoints::surface
const List< FixedList< label, 3 > > & surface() const
Definition: wallPoints.H:146
Foam::wallPoints::distSqr
const List< scalar > & distSqr() const
Definition: wallPoints.H:141
Foam::wallPoints::trackData::trackData
trackData(const bitSet &isBlockedFace)
Definition: wallPoints.H:74
Foam::wallPoints::operator<<
friend Ostream & operator<<(Ostream &, const wallPoints &)
Foam::operator>>
Istream & operator>>(Istream &, directionInfo &)
Definition: directionInfo.C:230
Foam::wallPoints::surface_
DynamicList< FixedList< label, 3 > > surface_
Originating surface,region and topological region.
Definition: wallPoints.H:92
bitSet.H
tensor.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::wallPoints::updateCell
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
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Foam::wallPoints::operator==
bool operator==(const wallPoints &) const
Test for equality.
Definition: wallPointsI.H:339
Foam::wallPoints::origin
const List< point > & origin() const
Definition: wallPoints.H:137
labelList.H
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::wallPoints::trackData
Class used to pass additional data in.
Definition: wallPoints.H:67
Foam::wallPoints::update
bool update(const point &pt, const label index1, const wallPoints &w2, const label index2, const scalar tol, TrackingData &td)
Originating normal.
Definition: wallPointsI.H:35
Foam::wallPoints::wallPoints
wallPoints()
Default construct.
Definition: wallPointsI.H:90
w2
#define w2
Definition: blockCreate.C:35
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::wallPoints::sameGeometry
bool sameGeometry(const polyMesh &, const wallPoints &, const scalar, TrackingData &td) const
Check for identical geometrical data (eg, cyclics checking)
Definition: wallPointsI.H:126
Foam::wallPoints::enterDomain
void enterDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Reverse of leaveDomain.
Definition: wallPointsI.H:174
Foam::wallPoints::leaveDomain
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
wallPointsI.H
Foam::Vector< scalar >
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
Foam::FixedList< label, 3 >
Foam::UList
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:103
Foam::wallPoints::trackData::isBlockedFace_
const bitSet & isBlockedFace_
Per face whether the face should not be walked through.
Definition: wallPoints.H:72
Foam::wallPoints::updateFace
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:235
DynamicList.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::wallPoints
For use with FaceCellWave. Determines topological distance to starting faces.
Definition: wallPoints.H:62
Foam::wallPoints::equal
bool equal(const wallPoints &, TrackingData &) const
Test for equality, with TrackingData.
Definition: wallPointsI.H:327