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