topoDistanceData.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2019-2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::topoDistanceData
29
30Description
31 For use with FaceCellWave. Determines topological distance to starting
32 faces. Templated on passive transported data.
33
34SourceFiles
35 topoDistanceDataI.H
36 topoDistanceData.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef topoDistanceData_H
41#define topoDistanceData_H
42
43#include "point.H"
44#include "tensor.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51// Forward Declarations
52class polyPatch;
53class polyMesh;
54template<class Type> class topoDistanceData;
55
56template<class Type>
58template<class Type>
60
61/*---------------------------------------------------------------------------*\
62 Class topoDistanceData Declaration
63\*---------------------------------------------------------------------------*/
64
65template<class Type>
67{
68 // Private Data
69
70 //- Distance
71 label distance_;
72
73 //- Starting data
74 Type data_;
75
76
77public:
78
79 // Constructors
80
81 //- Construct null with invalid (-1) for distance, null constructor
82 // for data
83 inline topoDistanceData();
84
85 //- Construct from components
86 inline topoDistanceData
87 (
88 const label distance,
89 const Type& data
90 );
91
92
93 // Member Functions
94
95 // Access
97 inline label distance() const
98 {
99 return distance_;
100 }
102 inline const Type& data() const
103 {
104 return data_;
105 }
106
107
108 // Needed by FaceCellWave
109
110 //- Changed or contains original (invalid) value
111 template<class TrackingData>
112 inline bool valid(TrackingData& td) const;
113
114 //- Check for identical geometrical data (eg, cyclics checking)
115 template<class TrackingData>
116 inline bool sameGeometry
117 (
118 const polyMesh&,
120 const scalar,
121 TrackingData& td
122 ) const;
123
124 //- Convert any absolute coordinates into relative to (patch)face
125 // centre
126 template<class TrackingData>
127 inline void leaveDomain
128 (
129 const polyMesh&,
130 const polyPatch&,
131 const label patchFacei,
132 const point& faceCentre,
133 TrackingData& td
134 );
135
136 //- Reverse of leaveDomain
137 template<class TrackingData>
138 inline void enterDomain
139 (
140 const polyMesh&,
141 const polyPatch&,
142 const label patchFacei,
143 const point& faceCentre,
144 TrackingData& td
145 );
146
147 //- Apply rotation matrix to any coordinates
148 template<class TrackingData>
149 inline void transform
150 (
151 const polyMesh&,
152 const tensor&,
153 TrackingData& td
154 );
155
156 //- Influence of neighbouring face.
157 template<class TrackingData>
158 inline bool updateCell
159 (
160 const polyMesh&,
161 const label thisCelli,
162 const label neighbourFacei,
163 const topoDistanceData<Type>& neighbourInfo,
164 const scalar tol,
165 TrackingData& td
166 );
167
168 //- Influence of neighbouring cell.
169 template<class TrackingData>
170 inline bool updateFace
171 (
172 const polyMesh&,
173 const label thisFacei,
174 const label neighbourCelli,
175 const topoDistanceData<Type>& neighbourInfo,
176 const scalar tol,
177 TrackingData& td
178 );
179
180 //- Influence of different value on same face.
181 template<class TrackingData>
182 inline bool updateFace
183 (
184 const polyMesh&,
185 const label thisFacei,
186 const topoDistanceData<Type>& neighbourInfo,
187 const scalar tol,
188 TrackingData& td
189 );
190
191 //- Test for equality, with TrackingData
192 template<class TrackingData>
193 inline bool equal
194 (
196 TrackingData& td
197 ) const;
198
199
200 // Member Operators
201
202 // Needed for List IO
203 inline bool operator==(const topoDistanceData<Type>&) const;
204
205 inline bool operator!=(const topoDistanceData<Type>&) const;
206
207
208 // IOstream Operators
210 friend Ostream& operator<< <Type>
211 (
212 Ostream&,
214 );
215 friend Istream& operator>> <Type>
216 (
217 Istream&,
219 );
220};
221
222
223// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
224
225//- Data are contiguous if data type is contiguous
226template<class Type>
227struct is_contiguous<topoDistanceData<Type>> : is_contiguous<Type> {};
228
229//- Data are contiguous label if data type is label
230template<class Type>
232 is_contiguous_label<Type> {};
233
234//- Data are contiguous scalar if data type is scalar
235template<class Type>
237 is_contiguous_scalar<Type>{};
238
239// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
240
241} // End namespace Foam
242
243// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
244
245#ifdef NoRepository
246 #include "topoDistanceData.C"
247#endif
248
249// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
250
251#include "topoDistanceDataI.H"
252
253// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
254
255#endif
256
257// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Database for solution data, solver performance and other reduced data.
Definition: data.H:58
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
For use with FaceCellWave. Determines topological distance to starting faces. Templated on passive tr...
void transform(const polyMesh &, const tensor &, TrackingData &td)
Apply rotation matrix to any coordinates.
void enterDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Reverse of leaveDomain.
bool updateFace(const polyMesh &, const label thisFacei, const label neighbourCelli, const topoDistanceData< Type > &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
bool updateCell(const polyMesh &, const label thisCelli, const label neighbourFacei, const topoDistanceData< Type > &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
bool operator!=(const topoDistanceData< Type > &) const
bool sameGeometry(const polyMesh &, const topoDistanceData< Type > &, const scalar, TrackingData &td) const
Check for identical geometrical data (eg, cyclics checking)
topoDistanceData()
Construct null with invalid (-1) for distance, null constructor.
bool equal(const topoDistanceData< Type > &, TrackingData &td) const
Test for equality, with TrackingData.
bool valid(TrackingData &td) const
Changed or contains original (invalid) value.
void leaveDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Convert any absolute coordinates into relative to (patch)face.
const Type & data() const
bool operator==(const topoDistanceData< Type > &) const
Namespace for OpenFOAM.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Istream & operator>>(Istream &, directionInfo &)
A template class to specify if a data type is composed solely of Foam::label elements.
Definition: contiguous.H:86
A template class to specify if a data type is composed solely of Foam::scalar elements.
Definition: contiguous.H:94
A template class to specify that a data type can be considered as being contiguous in memory.
Definition: contiguous.H:78