PatchEdgeFacePointDataI.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-2023 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 \*---------------------------------------------------------------------------*/
25 
26 #include "PatchEdgeFacePointData.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
30 template<class Type>
32 :
34  data_()
35 {}
36 
37 
38 template<class Type>
40 (
41  const Type& data,
42  const point& origin,
43  const scalar distSqr
44 )
45 :
46  patchEdgeFacePoint(origin, distSqr),
47  data_(data)
48 {}
49 
50 
51 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
52 
53 template<class Type>
54 inline const Type& Foam::PatchEdgeFacePointData<Type>::data() const
55 {
56  return data_;
57 }
58 
59 
60 template<class Type>
62 {
63  return data_;
64 }
65 
66 
67 template<class Type>
68 template<class TrackingData>
70 (
71  TrackingData& td
72 ) const
73 {
74  return data_;
75 }
76 
77 
78 template<class Type>
79 template<class TrackingData>
81 (
82  const polyMesh& mesh,
83  const primitivePatch& patch,
84  const tensor& rotTensor,
85  const scalar tol,
86  TrackingData& td
87 )
88 {
89  patchEdgeFacePoint::transform(mesh, patch, rotTensor, tol, td);
90 
91  data_ = Foam::transform(rotTensor, data_);
92 }
93 
94 
95 template<class Type>
96 template<class TrackingData>
98 (
99  const polyMesh& mesh,
100  const primitivePatch& patch,
101  const label edgei,
102  const label facei,
103  const PatchEdgeFacePointData<Type>& faceInfo,
104  const scalar tol,
105  TrackingData& td
106 )
107 {
108  const bool result =
110  (
111  mesh,
112  patch,
113  edgei,
114  facei,
115  faceInfo,
116  tol,
117  td
118  );
119 
120  if (result)
121  {
122  data_ = faceInfo.data_;
123  }
124 
125  return result;
126 }
127 
128 
129 template<class Type>
130 template<class TrackingData>
132 (
133  const polyMesh& mesh,
134  const primitivePatch& patch,
135  const PatchEdgeFacePointData<Type>& edgeInfo,
136  const bool sameOrientation,
137  const scalar tol,
138  TrackingData& td
139 )
140 {
141  const bool result =
143  (
144  mesh,
145  patch,
146  edgeInfo,
147  sameOrientation,
148  tol,
149  td
150  );
151 
152  if (result)
153  {
154  data_ = edgeInfo.data_;
155  }
156 
157  return result;
158 }
159 
160 
161 template<class Type>
162 template<class TrackingData>
164 (
165  const polyMesh& mesh,
166  const primitivePatch& patch,
167  const label facei,
168  const label edgei,
169  const PatchEdgeFacePointData<Type>& edgeInfo,
170  const scalar tol,
171  TrackingData& td
172 )
173 {
174  const bool result =
176  (
177  mesh,
178  patch,
179  facei,
180  edgei,
181  edgeInfo,
182  tol,
183  td
184  );
185 
186  if (result)
187  {
188  data_ = edgeInfo.data_;
189  }
190 
191  return result;
192 }
193 
194 
195 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
196 
197 template<class Type>
198 Foam::Ostream& Foam::operator<<
199 (
200  Ostream& os,
201  const PatchEdgeFacePointData<Type>& wDist
202 )
203 {
204  return
205  os
206  << static_cast<const patchEdgeFacePoint&>(wDist)
207  << token::SPACE
208  << wDist.data_;
209 }
210 
211 
212 template<class Type>
213 Foam::Istream& Foam::operator>>
214 (
215  Istream& is,
216  PatchEdgeFacePointData<Type>& wDist
217 )
218 {
219  return is >> static_cast<patchEdgeFacePoint&>(wDist) >> wDist.data_;
220 }
221 
222 
223 // ************************************************************************* //
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
Transport of nearest point location, plus data, for use in PatchEdgeFaceWave.
bool updateFace(const polyMesh &mesh, const primitivePatch &patch, const label facei, const label edgei, const PatchEdgeFacePointData< Type > &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on face.
bool updateEdge(const polyMesh &mesh, const primitivePatch &patch, const label edgei, const label facei, const PatchEdgeFacePointData< Type > &faceInfo, const scalar tol, TrackingData &td)
Influence of face on edge.
void transform(const polyMesh &mesh, const primitivePatch &patch, const tensor &rotTensor, const scalar tol, TrackingData &td)
Apply rotation matrix.
A list of faces which address into the list of points.
Database for solution and other reduced data.
Definition: data.H:54
Transport of nearest point location for use in PatchEdgeFaceWave.
bool updateFace(const polyMesh &mesh, const primitivePatch &patch, const label facei, const label edgei, const patchEdgeFacePoint &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on face.
bool updateEdge(const polyMesh &mesh, const primitivePatch &patch, const label edgei, const label facei, const patchEdgeFacePoint &faceInfo, const scalar tol, TrackingData &td)
Influence of face on edge.
void transform(const polyMesh &mesh, const primitivePatch &patch, const tensor &rotTensor, const scalar tol, TrackingData &td)
Apply rotation matrix.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
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
dimensionSet transform(const dimensionSet &)
Definition: dimensionSet.C:483