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
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 
202  friend Ostream& operator<<(Ostream&, const pointTopoDistanceData&);
203  friend Istream& operator>>(Istream&, pointTopoDistanceData&);
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 // ************************************************************************* //
Foam::Tensor
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
Definition: complexI.H:224
Foam::pointTopoDistanceData::operator<<
friend Ostream & operator<<(Ostream &, const pointTopoDistanceData &)
Foam::pointTopoDistanceData::updatePoint
bool updatePoint(const polyMesh &mesh, const label pointI, const label edgeI, const pointTopoDistanceData &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on point.
Definition: pointTopoDistanceDataI.H:112
point.H
Foam::tensor
Tensor< scalar > tensor
Tensor of scalars.
Definition: tensor.H:51
Foam::pointTopoDistanceData::distance_
label distance_
Distance.
Definition: pointTopoDistanceData.H:62
Foam::pointTopoDistanceData::enterDomain
void enterDomain(const polyPatch &patch, const label patchPointI, const point &pos, TrackingData &td)
Convert relative origin to absolute by adding entering point.
Definition: pointTopoDistanceDataI.H:100
Foam::pointTopoDistanceData::data
label data() const
Definition: pointTopoDistanceData.H:85
tensor.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::pointTopoDistanceData
For use with PointEdgeWave. Determines topological distance to starting points.
Definition: pointTopoDistanceData.H:54
Foam::pointTopoDistanceData::operator!=
bool operator!=(const pointTopoDistanceData &) const
Definition: pointTopoDistanceDataI.H:225
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:59
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Foam::contiguous< pointTopoDistanceData >
bool contiguous< pointTopoDistanceData >()
Data associated with pointTopoDistanceData type are contiguous.
Definition: pointTopoDistanceData.H:208
pointTopoDistanceDataI.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::pointTopoDistanceData::updateEdge
bool updateEdge(const polyMesh &mesh, const label edgeI, const label pointI, const pointTopoDistanceData &pointInfo, const scalar tol, TrackingData &td)
Influence of point on edge.
Definition: pointTopoDistanceDataI.H:181
Foam::pointTopoDistanceData::data_
label data_
Starting data.
Definition: pointTopoDistanceData.H:59
Foam::pointTopoDistanceData::sameGeometry
bool sameGeometry(const pointTopoDistanceData &, const scalar tol, TrackingData &td) const
Check for identical geometrical data. Used for cyclics checking.
Definition: pointTopoDistanceDataI.H:65
Foam::Vector< scalar >
Foam::pointTopoDistanceData::pointTopoDistanceData
pointTopoDistanceData()
Construct null.
Definition: pointTopoDistanceDataI.H:34
Foam::pointTopoDistanceData::operator==
bool operator==(const pointTopoDistanceData &) const
Definition: pointTopoDistanceDataI.H:216
Foam::pointTopoDistanceData::distance
label distance() const
Definition: pointTopoDistanceData.H:89
Foam::pointTopoDistanceData::leaveDomain
void leaveDomain(const polyPatch &patch, const label patchPointI, const point &pos, TrackingData &td)
Convert origin to relative vector to leaving point.
Definition: pointTopoDistanceDataI.H:78
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::point
vector point
Point is a vector.
Definition: point.H:41
Foam::pointTopoDistanceData::transform
void transform(const tensor &rotTensor, TrackingData &td)
Apply rotation matrix to origin.
Definition: pointTopoDistanceDataI.H:90
Foam::data
Database for solution data, solver performance and other reduced data.
Definition: data.H:52
Foam::pointTopoDistanceData::equal
bool equal(const pointTopoDistanceData &, TrackingData &) const
Same (like operator==)
Definition: pointTopoDistanceDataI.H:204
Foam::pointTopoDistanceData::valid
bool valid(TrackingData &td) const
Check whether origin has been changed at all or.
Definition: pointTopoDistanceDataI.H:56
Foam::pos
dimensionedScalar pos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:190
Foam::pointTopoDistanceData::operator>>
friend Istream & operator>>(Istream &, pointTopoDistanceData &)