externalPointEdgePoint.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::externalPointEdgePoint
26 
27 Description
28  Holds information regarding nearest wall point. Used in PointEdgeWave.
29  (so not standard FaceCellWave)
30  To be used in wall distance calculation.
31 
32 SourceFiles
33  externalPointEdgePointI.H
34  externalPointEdgePoint.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef externalPointEdgePoint_H
39 #define externalPointEdgePoint_H
40 
41 #include "pointField.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declaration of classes
49 class polyPatch;
50 class polyMesh;
51 class transformer;
52 
53 
54 // Forward declaration of friend functions and operators
55 
56 class externalPointEdgePoint;
57 
58 Istream& operator>>(Istream&, externalPointEdgePoint&);
59 Ostream& operator<<(Ostream&, const externalPointEdgePoint&);
60 
61 
62 /*---------------------------------------------------------------------------*\
63  Class externalPointEdgePoint Declaration
64 \*---------------------------------------------------------------------------*/
65 
67 {
68  // Private Data
69 
70  //- Position of nearest wall center
71  point origin_;
72 
73  //- Normal distance (squared) from point to origin
74  scalar distSqr_;
75 
76 
77  // Private Member Functions
78 
79  //- Evaluate distance to point. Update distSqr, origin from whomever
80  // is nearer pt. Return true if w2 is closer to point,
81  // false otherwise.
82  template<class TrackingData>
83  inline bool update
84  (
85  const point&,
87  const scalar tol,
88  TrackingData& td
89  );
90 
91  //- Combine current with w2. Update distSqr, origin if w2 has smaller
92  // quantities and returns true.
93  template<class TrackingData>
94  inline bool update
95  (
97  const scalar tol,
98  TrackingData& td
99  );
100 
101 
102 public:
103 
104  //- Class used to pass data into container
105  class trackingData
106  {
107  public:
108  const pointField& points_;
109 
111  :
112  points_(points)
113  {}
114  };
115 
116 
117 
118  // Constructors
119 
120  //- Construct null
121  inline externalPointEdgePoint();
122 
123  //- Construct from origin, distance
124  inline externalPointEdgePoint(const point&, const scalar);
125 
126 
127  // Member Functions
128 
129  // Access
130 
131  inline const point& origin() const;
132 
133  inline scalar distSqr() const;
134 
135 
136  // Needed by PointEdgeWave
137 
138  //- Check whether origin has been changed at all or
139  // still contains original (invalid) value.
140  template<class TrackingData>
141  inline bool valid(TrackingData& td) const;
142 
143  //- Check for identical geometrical data. Used for cyclics checking.
144  template<class TrackingData>
145  inline bool sameGeometry
146  (
147  const externalPointEdgePoint&,
148  const scalar tol,
149  TrackingData& td
150  ) const;
151 
152  //- Transform across an interface
153  template<class TrackingData>
154  inline void transform
155  (
156  const polyPatch& patch,
157  const label patchFacei,
158  const transformer& transform,
159  TrackingData& td
160  );
161 
162  //- Influence of edge on point
163  template<class TrackingData>
164  inline bool updatePoint
165  (
166  const polyMesh& mesh,
167  const label pointi,
168  const label edgeI,
169  const externalPointEdgePoint& edgeInfo,
170  const scalar tol,
171  TrackingData& td
172  );
173 
174  //- Influence of different value on same point.
175  // Merge new and old info.
176  template<class TrackingData>
177  inline bool updatePoint
178  (
179  const polyMesh& mesh,
180  const label pointi,
181  const externalPointEdgePoint& newPointInfo,
182  const scalar tol,
183  TrackingData& td
184  );
185 
186  //- Influence of different value on same point.
187  // No information about current position whatsoever.
188  template<class TrackingData>
189  inline bool updatePoint
190  (
191  const externalPointEdgePoint& newPointInfo,
192  const scalar tol,
193  TrackingData& td
194  );
195 
196  //- Influence of point on edge.
197  template<class TrackingData>
198  inline bool updateEdge
199  (
200  const polyMesh& mesh,
201  const label edgeI,
202  const label pointi,
203  const externalPointEdgePoint& pointInfo,
204  const scalar tol,
205  TrackingData& td
206  );
207 
208  //- Equivalent to operator== with TrackingData
209  template<class TrackingData>
210  inline bool equal
211  (
212  const externalPointEdgePoint&,
213  TrackingData& td
214  ) const;
215 
216 
217  // Member Operators
218 
219  // Needed for List IO
220  inline bool operator==(const externalPointEdgePoint&) const;
221  inline bool operator!=(const externalPointEdgePoint&) const;
222 
223 
224  // IOstream Operators
225 
228 };
229 
230 
231 //- Data associated with externalPointEdgePoint type are contiguous
232 template<>
234 {
235  return true;
236 }
237 
238 
239 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
240 
241 } // End namespace Foam
242 
243 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
244 
245 #include "externalPointEdgePointI.H"
246 
247 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
248 
249 #endif
250 
251 // ************************************************************************* //
#define w2
Definition: blockCreate.C:32
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
Class used to pass data into container.
Holds information regarding nearest wall point. Used in PointEdgeWave. (so not standard FaceCellWave)...
bool equal(const externalPointEdgePoint &, TrackingData &td) const
Equivalent to operator== with TrackingData.
bool sameGeometry(const externalPointEdgePoint &, const scalar tol, TrackingData &td) const
Check for identical geometrical data. Used for cyclics checking.
bool operator!=(const externalPointEdgePoint &) const
bool updatePoint(const polyMesh &mesh, const label pointi, const label edgeI, const externalPointEdgePoint &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on point.
bool updateEdge(const polyMesh &mesh, const label edgeI, const label pointi, const externalPointEdgePoint &pointInfo, const scalar tol, TrackingData &td)
Influence of point on edge.
bool valid(TrackingData &td) const
Check whether origin has been changed at all or.
friend Ostream & operator<<(Ostream &, const externalPointEdgePoint &)
friend Istream & operator>>(Istream &, externalPointEdgePoint &)
void transform(const polyPatch &patch, const label patchFacei, const transformer &transform, TrackingData &td)
Transform across an interface.
bool operator==(const externalPointEdgePoint &) const
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:70
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space.
Definition: transformer.H:84
const pointField & points
Namespace for OpenFOAM.
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:59
bool contiguous< externalPointEdgePoint >()
Data associated with externalPointEdgePoint type are contiguous.
Istream & operator>>(Istream &, directionInfo &)
Ostream & operator<<(Ostream &, const ensightPart &)