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-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::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 // 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 pointTopoDistanceData;
57 
58 Istream& operator>>(Istream&, pointTopoDistanceData&);
59 Ostream& operator<<(Ostream&, const pointTopoDistanceData&);
60 
61 
62 /*---------------------------------------------------------------------------*\
63  Class pointTopoDistanceData Declaration
64 \*---------------------------------------------------------------------------*/
65 
67 {
68  // Private Data
69 
70  //- Starting data
71  label data_;
72 
73  //- Distance
74  label distance_;
75 
76 
77 public:
78 
79  // Constructors
80 
81  //- Construct null
82  inline pointTopoDistanceData();
83 
84  //- Construct from count
86  (
87  const label data,
88  const label distance
89  );
90 
91 
92  // Member Functions
93 
94  // Access
95 
96 
97  inline label data() const
98  {
99  return data_;
100  }
101  inline label distance() const
102  {
103  return distance_;
104  }
105 
106 
107  // Needed by PointEdgeWave
108 
109 
110  //- Check whether origin has been changed at all or
111  // still contains original (invalid) value.
112  template<class TrackingData>
113  inline bool valid(TrackingData& td) const;
114 
115  //- Check for identical geometrical data. Used for cyclics checking.
116  template<class TrackingData>
117  inline bool sameGeometry
118  (
119  const pointTopoDistanceData&,
120  const scalar tol,
121  TrackingData& td
122  ) const;
123 
124  //- Transform across an interface
125  template<class TrackingData>
126  inline void transform
127  (
128  const polyPatch& patch,
129  const label patchFacei,
130  const transformer& transform,
131  TrackingData& td
132  );
133 
134  //- Influence of edge on point
135  template<class TrackingData>
136  inline bool updatePoint
137  (
138  const polyMesh& mesh,
139  const label pointi,
140  const label edgeI,
141  const pointTopoDistanceData& edgeInfo,
142  const scalar tol,
143  TrackingData& td
144  );
145 
146  //- Influence of different value on same point.
147  // Merge new and old info.
148  template<class TrackingData>
149  inline bool updatePoint
150  (
151  const polyMesh& mesh,
152  const label pointi,
153  const pointTopoDistanceData& newPointInfo,
154  const scalar tol,
155  TrackingData& td
156  );
157 
158  //- Influence of different value on same point.
159  // No information about current position whatsoever.
160  template<class TrackingData>
161  inline bool updatePoint
162  (
163  const pointTopoDistanceData& newPointInfo,
164  const scalar tol,
165  TrackingData& td
166  );
167 
168  //- Influence of point on edge.
169  template<class TrackingData>
170  inline bool updateEdge
171  (
172  const polyMesh& mesh,
173  const label edgeI,
174  const label pointi,
175  const pointTopoDistanceData& pointInfo,
176  const scalar tol,
177  TrackingData& td
178  );
179 
180  //- Same (like operator==)
181  template<class TrackingData>
182  inline bool equal(const pointTopoDistanceData&, TrackingData&)
183  const;
184 
185 
186  // Member Operators
187 
188  // Needed for List IO
189  inline bool operator==(const pointTopoDistanceData&) const;
190  inline bool operator!=(const pointTopoDistanceData&) const;
191 
192  // IOstream Operators
193 
196 };
197 
198 
199 //- Data associated with pointTopoDistanceData type are contiguous
200 template<>
202 {
203  return true;
204 }
205 
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 } // End namespace Foam
210 
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 
213 #include "pointTopoDistanceDataI.H"
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 #endif
218 
219 // ************************************************************************* //
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
Database for solution and other reduced data.
Definition: data.H:54
For use with PointEdgeWave. Determines topological distance to starting points.
bool operator==(const pointTopoDistanceData &) const
bool updateEdge(const polyMesh &mesh, const label edgeI, const label pointi, const pointTopoDistanceData &pointInfo, const scalar tol, TrackingData &td)
Influence of point on edge.
bool updatePoint(const polyMesh &mesh, const label pointi, const label edgeI, const pointTopoDistanceData &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on point.
friend Istream & operator>>(Istream &, pointTopoDistanceData &)
bool operator!=(const pointTopoDistanceData &) const
friend Ostream & operator<<(Ostream &, const pointTopoDistanceData &)
bool equal(const pointTopoDistanceData &, TrackingData &) const
Same (like operator==)
bool sameGeometry(const pointTopoDistanceData &, const scalar tol, TrackingData &td) const
Check for identical geometrical data. Used for cyclics checking.
bool valid(TrackingData &td) const
Check whether origin has been changed at all or.
void transform(const polyPatch &patch, const label patchFacei, const transformer &transform, TrackingData &td)
Transform across an interface.
Namespace for OpenFOAM.
bool contiguous< pointTopoDistanceData >()
Data associated with pointTopoDistanceData type are contiguous.
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
Istream & operator>>(Istream &, directionInfo &)
Ostream & operator<<(Ostream &, const ensightPart &)