pointTopoDistanceData.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-2020 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::pointTopoDistanceData
26 
27 Description
28  For use with PointEdgeWave. Determines topological distance to
29  starting points
30 
31 SourceFiles
32  pointTopoDistanceDataI.H
33  pointTopoDistanceData.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef pointTopoDistanceData_H
38 #define pointTopoDistanceData_H
39 
40 #include "point.H"
41 #include "tensor.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 class polyPatch;
49 class polyMesh;
50 
51 
52 // Forward declaration of friend functions and operators
53 
54 class pointTopoDistanceData;
55 
56 Istream& operator>>(Istream&, pointTopoDistanceData&);
57 Ostream& operator<<(Ostream&, const pointTopoDistanceData&);
58 
59 
60 /*---------------------------------------------------------------------------*\
61  Class pointTopoDistanceData Declaration
62 \*---------------------------------------------------------------------------*/
63 
65 {
66  // Private Data
67 
68  //- Starting data
69  label data_;
70 
71  //- Distance
72  label distance_;
73 
74 
75 public:
76 
77  // Constructors
78 
79  //- Construct null
80  inline pointTopoDistanceData();
81 
82  //- Construct from count
84  (
85  const label data,
86  const label distance
87  );
88 
89 
90  // Member Functions
91 
92  // Access
93 
94 
95  inline label data() const
96  {
97  return data_;
98  }
99  inline label distance() const
100  {
101  return distance_;
102  }
103 
104 
105  // Needed by PointEdgeWave
106 
107 
108  //- Check whether origin has been changed at all or
109  // still contains original (invalid) value.
110  template<class TrackingData>
111  inline bool valid(TrackingData& td) const;
112 
113  //- Check for identical geometrical data. Used for cyclics checking.
114  template<class TrackingData>
115  inline bool sameGeometry
116  (
117  const pointTopoDistanceData&,
118  const scalar tol,
119  TrackingData& td
120  ) const;
121 
122  //- Convert origin to relative vector to leaving point
123  // (= point coordinate)
124  template<class TrackingData>
125  inline void leaveDomain
126  (
127  const polyPatch& patch,
128  const label patchPointi,
129  const point& pos,
130  TrackingData& td
131  );
132 
133  //- Convert relative origin to absolute by adding entering point
134  template<class TrackingData>
135  inline void enterDomain
136  (
137  const polyPatch& patch,
138  const label patchPointi,
139  const point& pos,
140  TrackingData& td
141  );
142 
143  //- Apply rotation matrix to origin
144  template<class TrackingData>
145  inline void transform
146  (
147  const tensor& rotTensor,
148  TrackingData& td
149  );
150 
151  //- Influence of edge on point
152  template<class TrackingData>
153  inline bool updatePoint
154  (
155  const polyMesh& mesh,
156  const label pointi,
157  const label edgeI,
158  const pointTopoDistanceData& edgeInfo,
159  const scalar tol,
160  TrackingData& td
161  );
162 
163  //- Influence of different value on same point.
164  // Merge new and old info.
165  template<class TrackingData>
166  inline bool updatePoint
167  (
168  const polyMesh& mesh,
169  const label pointi,
170  const pointTopoDistanceData& newPointInfo,
171  const scalar tol,
172  TrackingData& td
173  );
174 
175  //- Influence of different value on same point.
176  // No information about current position whatsoever.
177  template<class TrackingData>
178  inline bool updatePoint
179  (
180  const pointTopoDistanceData& newPointInfo,
181  const scalar tol,
182  TrackingData& td
183  );
184 
185  //- Influence of point on edge.
186  template<class TrackingData>
187  inline bool updateEdge
188  (
189  const polyMesh& mesh,
190  const label edgeI,
191  const label pointi,
192  const pointTopoDistanceData& pointInfo,
193  const scalar tol,
194  TrackingData& td
195  );
196 
197  //- Same (like operator==)
198  template<class TrackingData>
199  inline bool equal(const pointTopoDistanceData&, TrackingData&)
200  const;
201 
202 
203  // Member Operators
204 
205  // Needed for List IO
206  inline bool operator==(const pointTopoDistanceData&) const;
207  inline bool operator!=(const pointTopoDistanceData&) const;
208 
209  // IOstream Operators
210 
213 };
214 
215 
216 //- Data associated with pointTopoDistanceData type are contiguous
217 template<>
219 {
220  return true;
221 }
222 
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
226 } // End namespace Foam
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 #include "pointTopoDistanceDataI.H"
231 
232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233 
234 #endif
235 
236 // ************************************************************************* //
bool equal(const pointTopoDistanceData &, TrackingData &) const
Same (like operator==)
void transform(const tensor &rotTensor, TrackingData &td)
Apply rotation matrix to origin.
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
void leaveDomain(const polyPatch &patch, const label patchPointi, const point &pos, TrackingData &td)
Convert origin to relative vector to leaving point.
friend Ostream & operator<<(Ostream &, const pointTopoDistanceData &)
bool valid(TrackingData &td) const
Check whether origin has been changed at all or.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
For use with PointEdgeWave. Determines topological distance to starting points.
dimensionedScalar pos(const dimensionedScalar &ds)
dynamicFvMesh & mesh
bool updateEdge(const polyMesh &mesh, const label edgeI, const label pointi, const pointTopoDistanceData &pointInfo, const scalar tol, TrackingData &td)
Influence of point on edge.
Istream & operator>>(Istream &, directionInfo &)
bool operator!=(const pointTopoDistanceData &) const
bool sameGeometry(const pointTopoDistanceData &, const scalar tol, TrackingData &td) const
Check for identical geometrical data. Used for cyclics checking.
bool updatePoint(const polyMesh &mesh, const label pointi, const label edgeI, const pointTopoDistanceData &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on point.
void enterDomain(const polyPatch &patch, const label patchPointi, const point &pos, TrackingData &td)
Convert relative origin to absolute by adding entering point.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
Database for solution and other reduced data.
Definition: data.H:51
Ostream & operator<<(Ostream &, const ensightPart &)
friend Istream & operator>>(Istream &, pointTopoDistanceData &)
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
bool operator==(const pointTopoDistanceData &) const
Namespace for OpenFOAM.
bool contiguous< pointTopoDistanceData >()
Data associated with pointTopoDistanceData type are contiguous.