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