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