PointDataI.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-2015 OpenFOAM Foundation
9  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "polyMesh.H"
30 #include "transform.H"
31 
32 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 
34 template<class DataType>
36 :
38 {}
39 
40 
41 template<class DataType>
43 (
44  const point& origin,
45  const scalar distSqr,
46  const DataType& data
47 )
48 :
49  pointEdgePoint(origin, distSqr),
50  data_(data)
51 {}
52 
53 
54 template<class DataType>
56 :
57  pointEdgePoint(wpt),
58  data_(wpt.data())
59 {}
60 
61 
62 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
63 
64 template<class DataType>
65 inline const DataType& Foam::PointData<DataType>::data() const
66 {
67  return data_;
68 }
69 
70 
71 template<class DataType>
72 template<class TrackingData>
74 (
75  const tensor& rotTensor,
76  TrackingData& td
77 )
78 {
79  pointEdgePoint::transform(rotTensor, td);
80  data_ = Foam::transform(rotTensor, data_);
81 }
82 
83 
84 template<class DataType>
85 template<class TrackingData>
87 (
88  const polyMesh& mesh,
89  const label pointI,
90  const label edgeI,
91  const PointData<DataType>& edgeInfo,
92  const scalar tol,
93  TrackingData& td
94 )
95 {
96  if
97  (
99  (
100  mesh,
101  pointI,
102  edgeI,
103  edgeInfo,
104  tol,
105  td
106  )
107  )
108  {
109  data_ = edgeInfo.data_;
110 
111  return true;
112  }
113 
114  return false;
115 }
116 
117 
118 template<class DataType>
119 template<class TrackingData>
121 (
122  const polyMesh& mesh,
123  const label pointI,
124  const PointData<DataType>& newPointInfo,
125  const scalar tol,
126  TrackingData& td
127 )
128 {
129  if
130  (
132  (
133  mesh,
134  pointI,
135  newPointInfo,
136  tol,
137  td
138  )
139  )
140  {
141  data_ = newPointInfo.data_;
142 
143  return true;
144  }
145 
146  return false;
147 }
148 
149 
150 template<class DataType>
151 template<class TrackingData>
153 (
154  const PointData<DataType>& newPointInfo,
155  const scalar tol,
156  TrackingData& td
157 )
158 {
159  if (pointEdgePoint::updatePoint(newPointInfo, tol, td))
160  {
161  data_ = newPointInfo.data_;
162 
163  return true;
164  }
165 
166  return false;
167 }
168 
169 
170 template<class DataType>
171 template<class TrackingData>
173 (
174  const polyMesh& mesh,
175  const label edgeI,
176  const label pointI,
177  const PointData<DataType>& pointInfo,
178  const scalar tol,
179  TrackingData& td
180 
181 )
182 {
183  if
184  (
186  (
187  mesh,
188  edgeI,
189  pointI,
190  pointInfo,
191  tol,
192  td
193  )
194  )
195  {
196  data_ = pointInfo.data_;
197 
198  return true;
199  }
200 
201  return false;
202 }
203 
204 
205 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
206 
207 template<class DataType>
209 (
210  const Foam::PointData<DataType>& rhs
211 )
212 const
213 {
214  return pointEdgePoint::operator==(rhs) && (data() == rhs.data());
215 }
216 
217 
218 template<class DataType>
220 (
221  const Foam::PointData<DataType>& rhs
222 )
223 const
224 {
225  return !(*this == rhs);
226 }
227 
228 
229 // ************************************************************************* //
Foam::pointEdgePoint::updatePoint
bool updatePoint(const polyMesh &mesh, const label pointi, const label edgeI, const pointEdgePoint &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on point.
Definition: pointEdgePointI.H:243
Foam::Tensor< scalar >
Foam::PointData::data
const DataType & data() const
Const access the data.
Definition: PointDataI.H:65
Foam::pointEdgePoint::updateEdge
bool updateEdge(const polyMesh &mesh, const label edgeI, const label pointi, const pointEdgePoint &pointInfo, const scalar tol, TrackingData &td)
Influence of point on edge.
Definition: pointEdgePointI.H:287
Foam::PointData::PointData
PointData()
Construct null.
Definition: PointDataI.H:35
Foam::transform
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Definition: dimensionSet.C:519
polyMesh.H
Foam::pointEdgePoint::operator==
bool operator==(const pointEdgePoint &) const
Definition: pointEdgePointI.H:314
Foam::PointData
Variant of pointEdgePoint with some transported additional data. Templated on the transported data ty...
Definition: medialAxisMeshMover.H:60
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
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:62
Foam::PointData::updateEdge
bool updateEdge(const polyMesh &mesh, const label edgeI, const label pointI, const PointData< DataType > &pointInfo, const scalar tol, TrackingData &td)
Influence of point on edge.
Definition: PointDataI.H:173
Foam::pointEdgePoint::transform
void transform(const tensor &rotTensor, TrackingData &td)
Apply rotation matrix to origin.
Definition: pointEdgePointI.H:215
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::pointEdgePoint
Holds information regarding nearest wall point. Used in PointEdgeWave. (so not standard FaceCellWave)...
Definition: pointEdgePoint.H:67
Foam::PointData::transform
void transform(const tensor &rotTensor, TrackingData &td)
Apply rotation matrix to the data.
Definition: PointDataI.H:74
Foam::Vector< scalar >
Foam::PointData::updatePoint
bool updatePoint(const polyMesh &mesh, const label pointI, const label edgeI, const PointData< DataType > &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on point.
Definition: PointDataI.H:87
transform.H
3D tensor transformation operations.
Foam::data
Database for solution data, solver performance and other reduced data.
Definition: data.H:54