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 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 // Forward Declarations
52 class polyPatch;
53 class polyMesh;
54 class wallPoints;
55 Istream& operator>>(Istream&, wallPoints&);
56 Ostream& operator<<(Ostream&, const wallPoints&);
57 
58 /*---------------------------------------------------------------------------*\
59  Class wallPoints Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class wallPoints
63 {
64 protected:
65 
66  // Protected Data
67 
68  //- Starting points
70 
71  //- Distance (squared) from cellcenter to origin
73 
74  //- Originating surface,region and topological region
76 
77  //- Originating normal
78  //DynamicList<vector> normal_;
79 
80 
81  // Protected Member Functions
82 
83  //- Evaluate distance to point.
84  // Update distSqr, origin from whomever is nearer pt.
85  // \return true if w2 is closer to point, false otherwise.
86  template<class TrackingData>
87  inline bool update
88  (
89  const point& pt,
90  const label index1,
91  const wallPoints& w2,
92  const label index2,
93 
94  const scalar tol,
95  TrackingData& td
96  );
97 
98 
99 public:
100 
101  // Constructors
102 
103  //- Default construct
104  inline wallPoints();
105 
106  //- Construct from count
107  inline wallPoints
108  (
109  const UList<point>& origin,
110  const UList<scalar>& distSqr,
112  //const UList<vector>& normal
113  );
114 
115 
116  // Member Functions
117 
118  // Access
119 
120  const List<point>& origin() const
121  {
122  return origin_;
123  }
124  const List<scalar>& distSqr() const
125  {
126  return distSqr_;
127  }
128 
129  const List<FixedList<label, 3>>& surface() const
130  {
131  return surface_;
132  }
133 
134  //const List<vector>& normal() const
135  //{
136  // return normal_;
137  //}
138 
139 
140  // Needed by FaceCellWave
141 
142  //- Changed or contains original (invalid) value
143  template<class TrackingData>
144  inline bool valid(TrackingData& td) const;
145 
146  //- Check for identical geometrical data (eg, cyclics checking)
147  template<class TrackingData>
148  inline bool sameGeometry
149  (
150  const polyMesh&,
151  const wallPoints&,
152  const scalar,
153  TrackingData& td
154  ) const;
155 
156  //- Convert any absolute coordinates into relative to (patch)face
157  // centre
158  template<class TrackingData>
159  inline void leaveDomain
160  (
161  const polyMesh&,
162  const polyPatch&,
163  const label patchFacei,
164  const point& faceCentre,
165  TrackingData& td
166  );
167 
168  //- Reverse of leaveDomain
169  template<class TrackingData>
170  inline void enterDomain
171  (
172  const polyMesh&,
173  const polyPatch&,
174  const label patchFacei,
175  const point& faceCentre,
176  TrackingData& td
177  );
178 
179  //- Apply rotation matrix to any coordinates
180  template<class TrackingData>
181  inline void transform
182  (
183  const polyMesh&,
184  const tensor&,
185  TrackingData& td
186  );
187 
188  //- Influence of neighbouring face.
189  template<class TrackingData>
190  inline bool updateCell
191  (
192  const polyMesh&,
193  const label thisCelli,
194  const label neighbourFacei,
195  const wallPoints& neighbourInfo,
196  const scalar tol,
197  TrackingData& td
198  );
199 
200  //- Influence of neighbouring cell.
201  template<class TrackingData>
202  inline bool updateFace
203  (
204  const polyMesh&,
205  const label thisFacei,
206  const label neighbourCelli,
207  const wallPoints& neighbourInfo,
208  const scalar tol,
209  TrackingData& td
210  );
211 
212  //- Influence of different value on same face.
213  template<class TrackingData>
214  inline bool updateFace
215  (
216  const polyMesh&,
217  const label thisFacei,
218  const wallPoints& neighbourInfo,
219  const scalar tol,
220  TrackingData& td
221  );
222 
223  //- Test for equality, with TrackingData
224  template<class TrackingData>
225  inline bool equal(const wallPoints&, TrackingData&) const;
226 
227 
228  // Member Operators
229 
230  //- Test for equality
231  inline bool operator==(const wallPoints&) const;
232 
233  //- Test for inequality
234  inline bool operator!=(const wallPoints&) const;
235 
236 
237  // IOstream Operators
238 
239  friend Ostream& operator<<(Ostream&, const wallPoints&);
240  friend Istream& operator>>(Istream&, wallPoints&);
241 };
242 
243 
244 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
245 
246 } // End namespace Foam
247 
248 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
249 
250 #include "wallPointsI.H"
251 
252 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
253 
254 #endif
255 
256 // ************************************************************************* //
Foam::wallPoints::distSqr_
DynamicList< scalar > distSqr_
Distance (squared) from cellcenter to origin.
Definition: wallPoints.H:71
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::wallPoints::operator!=
bool operator!=(const wallPoints &) const
Test for inequality.
Definition: wallPointsI.H:344
Foam::DynamicList< point >
Foam::wallPoints::operator>>
friend Istream & operator>>(Istream &, wallPoints &)
Foam::wallPoints::origin_
DynamicList< point > origin_
Starting points.
Definition: wallPoints.H:68
point.H
Foam::wallPoints::surface
const List< FixedList< label, 3 > > & surface() const
Definition: wallPoints.H:128
Foam::wallPoints::distSqr
const List< scalar > & distSqr() const
Definition: wallPoints.H:123
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:74
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:331
Foam::wallPoints::origin
const List< point > & origin() const
Definition: wallPoints.H:119
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::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::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:61
Foam::wallPoints::equal
bool equal(const wallPoints &, TrackingData &) const
Test for equality, with TrackingData.
Definition: wallPointsI.H:319