topoDistanceData.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) 2011-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::topoDistanceData
26 
27 Description
28  For use with FaceCellWave. Determines topological distance to starting faces
29 
30 SourceFiles
31  topoDistanceDataI.H
32  topoDistanceData.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef topoDistanceData_H
37 #define topoDistanceData_H
38 
39 #include "point.H"
40 #include "tensor.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // Forward declaration of classes
48 class polyPatch;
49 class polyMesh;
50 class transformer;
51 
52 
53 // Forward declaration of friend functions and operators
54 
55 class topoDistanceData;
56 
57 Istream& operator>>(Istream&, topoDistanceData&);
58 Ostream& operator<<(Ostream&, const topoDistanceData&);
59 
60 
61 /*---------------------------------------------------------------------------*\
62  Class topoDistanceData Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 class topoDistanceData
66 {
67  // Private Data
68 
69  //- Starting data
70  label data_;
71 
72  //- Distance
73  label distance_;
74 
75 
76 public:
77 
78  // Constructors
79 
80  //- Construct null
81  inline topoDistanceData();
82 
83  //- Construct from count
84  inline topoDistanceData
85  (
86  const label data,
87  const label distance
88  );
89 
90 
91  // Member Functions
92 
93  // Access
94 
95 
96  inline label data() const
97  {
98  return data_;
99  }
100  inline label distance() const
101  {
102  return distance_;
103  }
104 
105 
106  // Needed by FaceCellWave
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 polyMesh&,
118  const topoDistanceData&,
119  const scalar,
120  TrackingData& td
121  ) const;
122 
123  //- Transform across an interface
124  template<class TrackingData>
125  inline void transform
126  (
127  const polyPatch& patch,
128  const label patchFacei,
129  const transformer& transform,
130  TrackingData& td
131  );
132 
133  //- Influence of neighbouring face.
134  template<class TrackingData>
135  inline bool updateCell
136  (
137  const polyMesh&,
138  const label thisCelli,
139  const label neighbourFacei,
140  const topoDistanceData& neighbourInfo,
141  const scalar tol,
142  TrackingData& td
143  );
144 
145  //- Influence of neighbouring cell.
146  template<class TrackingData>
147  inline bool updateFace
148  (
149  const polyMesh&,
150  const label thisFacei,
151  const label neighbourCelli,
152  const topoDistanceData& neighbourInfo,
153  const scalar tol,
154  TrackingData& td
155  );
156 
157  //- Influence of different value on same face.
158  template<class TrackingData>
159  inline bool updateFace
160  (
161  const polyMesh&,
162  const label thisFacei,
163  const topoDistanceData& neighbourInfo,
164  const scalar tol,
165  TrackingData& td
166  );
167 
168  //- Same (like operator==)
169  template<class TrackingData>
170  inline bool equal(const topoDistanceData&, TrackingData& td) const;
171 
172  // Member Operators
173 
174  // Needed for List IO
175  inline bool operator==(const topoDistanceData&) const;
176 
177  inline bool operator!=(const topoDistanceData&) const;
178 
179 
180  // IOstream Operators
181 
184 };
185 
186 
187 //- Data associated with topoDistanceData type are contiguous
188 template<>
189 inline bool contiguous<topoDistanceData>()
190 {
191  return true;
192 }
193 
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 } // End namespace Foam
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #include "topoDistanceDataI.H"
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #endif
206 
207 // ************************************************************************* //
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
For use with FaceCellWave. Determines topological distance to starting faces.
bool updateCell(const polyMesh &, const label thisCelli, const label neighbourFacei, const topoDistanceData &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
bool updateFace(const polyMesh &, const label thisFacei, const label neighbourCelli, const topoDistanceData &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
bool sameGeometry(const polyMesh &, const topoDistanceData &, const scalar, TrackingData &td) const
Check for identical geometrical data. Used for cyclics checking.
bool equal(const topoDistanceData &, TrackingData &td) const
Same (like operator==)
topoDistanceData()
Construct null.
bool valid(TrackingData &td) const
Check whether origin has been changed at all or.
bool operator==(const topoDistanceData &) const
bool operator!=(const topoDistanceData &) const
friend Ostream & operator<<(Ostream &, const topoDistanceData &)
friend Istream & operator>>(Istream &, topoDistanceData &)
void transform(const polyPatch &patch, const label patchFacei, const transformer &transform, TrackingData &td)
Transform across an interface.
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< topoDistanceData >()
Data associated with topoDistanceData type are contiguous.
Istream & operator>>(Istream &, pistonPointEdgeData &)
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)