edgeTopoDistanceData.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) 2012-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::edgeTopoDistanceData
29
30Description
31 For use with PatchEdgeFaceWave. Determines topological distance to
32 starting edges. Templated on passive transported data.
33
34SourceFiles
35 edgeTopoDistanceDataI.H
36 edgeTopoDistanceData.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef edgeTopoDistanceData_H
41#define edgeTopoDistanceData_H
42
43#include "point.H"
44#include "tensor.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52// Forward Declarations
53class polyPatch;
54class polyMesh;
55template<class Type, class PrimitivePatchType>
56class edgeTopoDistanceData;
57
58template<class Type, class PrimitivePatchType>
59Istream& operator>>
60(
61 Istream&,
63);
64template<class Type, class PrimitivePatchType>
65Ostream& operator<<
66(
67 Ostream&,
69);
70
71
72/*---------------------------------------------------------------------------*\
73 Class edgeTopoDistanceData Declaration
74\*---------------------------------------------------------------------------*/
75
76template<class Type, class PrimitivePatchType = indirectPrimitivePatch>
78{
79protected:
80
81 // Protected data
82
83 //- Distance
84 label distance_;
85
86 //- Starting data
87 Type data_;
88
89
90public:
92 typedef Type dataType;
93
94 // Constructors
95
96 //- Construct null with invalid (-1) for distance, null constructor
97 // for data
98 inline edgeTopoDistanceData();
99
100 //- Construct from distance, data
102 (
103 const label distance,
104 const Type& data
105 );
106
107
108 // Member Functions
109
110 // Access
112 inline label distance() const
113 {
114 return distance_;
115 }
117 inline const Type& data() const
118 {
119 return data_;
120 }
121
122
123 // Needed by PatchEdgeFaceWave
124
125 //- Check whether origin has been changed at all or
126 // still contains original (invalid) value.
127 template<class TrackingData>
128 inline bool valid(TrackingData& td) const;
129
130 //- Apply rotation matrix
131 template<class TrackingData>
132 inline void transform
133 (
134 const polyMesh& mesh,
135 const PrimitivePatchType& patch,
136 const tensor& rotTensor,
137 const scalar tol,
138 TrackingData& td
139 );
140
141 //- Influence of face on edge
142 template<class TrackingData>
143 inline bool updateEdge
144 (
145 const polyMesh& mesh,
146 const PrimitivePatchType& patch,
147 const label edgeI,
148 const label facei,
150 const scalar tol,
151 TrackingData& td
152 );
153
154 //- New information for edge (from e.g. coupled edge)
155 template<class TrackingData>
156 inline bool updateEdge
157 (
158 const polyMesh& mesh,
159 const PrimitivePatchType& patch,
161 const bool sameOrientation,
162 const scalar tol,
163 TrackingData& td
164 );
165
166 //- Influence of edge on face.
167 template<class TrackingData>
168 inline bool updateFace
169 (
170 const polyMesh& mesh,
171 const PrimitivePatchType& patch,
172 const label facei,
173 const label edgeI,
175 const scalar tol,
176 TrackingData& td
177 );
178
179 //- Same (like operator==)
180 template<class TrackingData>
181 inline bool equal
182 (
184 TrackingData&
185 ) const;
186
187
188 // Member Operators
189
190 // Needed for List IO
191 inline bool operator==
192 (
194 ) const;
195 inline bool operator!=
196 (
198 ) const;
199
200
201 // IOstream Operators
203 friend Ostream& operator<< <Type, PrimitivePatchType>
204 (
205 Ostream&,
207 );
208 friend Istream& operator>> <Type, PrimitivePatchType>
209 (
210 Istream&,
212 );
213};
214
215
216// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
217
218
219//- Data are contiguous if data type is contiguous
220template<class Type, class PrimitivePatchType>
221struct is_contiguous<edgeTopoDistanceData<Type, PrimitivePatchType>> :
222 is_contiguous<Type> {};
223
224//- Data are contiguous label if data type is label
225template<class Type, class PrimitivePatchType>
226struct is_contiguous_label<edgeTopoDistanceData<Type, PrimitivePatchType>> :
227 is_contiguous_label<Type> {};
228
229//- Data are contiguous scalar if data type is scalar
230template<class Type, class PrimitivePatchType>
231struct is_contiguous_scalar<edgeTopoDistanceData<Type, PrimitivePatchType>> :
232 is_contiguous_scalar<Type>{};
233
234
235// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236
237} // End namespace Foam
238
239// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
240
241#ifdef NoRepository
242 #include "edgeTopoDistanceData.C"
243#endif
244
245// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246
248
249// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
250
251#endif
252
253// ************************************************************************* //
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
For use with PatchEdgeFaceWave. Determines topological distance to starting edges....
bool updateEdge(const polyMesh &mesh, const PrimitivePatchType &patch, const label edgeI, const label facei, const edgeTopoDistanceData< Type, PrimitivePatchType > &faceInfo, const scalar tol, TrackingData &td)
Influence of face on edge.
void transform(const polyMesh &mesh, const PrimitivePatchType &patch, const tensor &rotTensor, const scalar tol, TrackingData &td)
Apply rotation matrix.
bool valid(TrackingData &td) const
Check whether origin has been changed at all or.
bool updateFace(const polyMesh &mesh, const PrimitivePatchType &patch, const label facei, const label edgeI, const edgeTopoDistanceData< Type, PrimitivePatchType > &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on face.
edgeTopoDistanceData()
Construct null with invalid (-1) for distance, null constructor.
bool equal(const edgeTopoDistanceData< Type, PrimitivePatchType > &, TrackingData &) const
Same (like operator==)
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
dynamicFvMesh & mesh
Namespace for OpenFOAM.
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