PointIntegrateData.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) 2018-2020 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::PointIntegrateData
28 
29 Description
30  Integrate along selected edges using PointEdgeWave.
31 
32 SourceFiles
33  PointIntegrateDataI.H
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef PointIntegrateData_H
38 #define PointIntegrateData_H
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 // Forward Declarations
46 class Istream;
47 class Ostream;
48 template<class DataType> class PointIntegrateData;
49 
50 template<class DataType>
52 template<class DataType>
54 
55 /*---------------------------------------------------------------------------*\
56  Class PointIntegrateData declaration
57 \*---------------------------------------------------------------------------*/
58 
59 template<class DataType>
61 {
62  // Private Data
63 
64  //- Valid flag
65  bool valid_;
66 
67  //- Integrated data
68  DataType data_;
69 
70 
71 public:
72 
73  //- Class used to pass extra data
74  class trackingData
75  {
76  public:
77 
79 
80  trackingData(UList<DataType>& edgeData)
81  :
82  edgeData_(edgeData)
83  {}
84  };
85 
86 
87  // Constructors
88 
89  //- Default construct
90  inline PointIntegrateData();
91 
92  //- Construct from data
93  inline PointIntegrateData(const DataType& data);
94 
95 
96  // Member Functions
97 
98  // Access
99 
100  const DataType& data() const
101  {
102  return data_;
103  };
104  DataType& data()
105  {
106  return data_;
107  };
108 
109 
110  // Needed by PointEdgeWave
111 
112  //- Changed or contains original (invalid) value
113  template<class TrackingData>
114  inline bool valid(TrackingData& td) const;
115 
116  //- Check for identical geometrical data (eg, cyclics checking)
117  template<class TrackingData>
118  inline bool sameGeometry
119  (
120  const PointIntegrateData<DataType>&,
121  const scalar tol,
122  TrackingData& td
123  ) const;
124 
125  //- Convert origin to relative vector to leaving point
126  //- (= point coordinate)
127  template<class TrackingData>
128  inline void leaveDomain
129  (
130  const polyPatch& patch,
131  const label patchPointi,
132  const point& pos,
133  TrackingData& td
134  );
135 
136  //- Convert relative origin to absolute by adding entering point
137  template<class TrackingData>
138  inline void enterDomain
139  (
140  const polyPatch& patch,
141  const label patchPointi,
142  const point& pos,
143  TrackingData& td
144  );
145 
146  //- Apply rotation matrix to the data
147  template<class TrackingData>
148  inline void transform
149  (
150  const tensor& rotTensor,
151  TrackingData& td
152  );
153 
154  //- Influence of edge on point
155  template<class TrackingData>
156  inline bool updatePoint
157  (
158  const polyMesh& mesh,
159  const label pointI,
160  const label edgeI,
161  const PointIntegrateData<DataType>& edgeInfo,
162  const scalar tol,
163  TrackingData& td
164  );
165 
166  //- Influence of different value on same point.
167  // Merge new and old info.
168  template<class TrackingData>
169  inline bool updatePoint
170  (
171  const polyMesh& mesh,
172  const label pointI,
173  const PointIntegrateData<DataType>& newPointInfo,
174  const scalar tol,
175  TrackingData& td
176  );
177 
178  //- Influence of different value on same point.
179  // No information about current position whatsoever.
180  template<class TrackingData>
181  inline bool updatePoint
182  (
183  const PointIntegrateData<DataType>& newPointInfo,
184  const scalar tol,
185  TrackingData& td
186  );
187 
188  //- Influence of point on edge.
189  template<class TrackingData>
190  inline bool updateEdge
191  (
192  const polyMesh& mesh,
193  const label edgeI,
194  const label pointI,
195  const PointIntegrateData<DataType>& pointInfo,
196  const scalar tol,
197  TrackingData& td
198  );
199 
200  //- Test for equality, with TrackingData
201  template<class TrackingData>
202  inline bool equal
203  (
204  const PointIntegrateData<DataType>&,
205  TrackingData& td
206  ) const;
207 
208 
209  // Member Operators
210 
211  //- Test for equality
212  inline bool operator==(const PointIntegrateData<DataType>&) const;
213 
214  //- Test for inequality
215  inline bool operator!=(const PointIntegrateData<DataType>&) const;
216 
217 
218  // IOstream Operators
219 
220  friend Ostream& operator<< <DataType>
221  (
222  Ostream&,
223  const PointIntegrateData<DataType>&
224  );
225  friend Istream& operator>> <DataType>
226  (
227  Istream&,
228  PointIntegrateData<DataType>&
229  );
230 };
231 
232 
233 // * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
234 
235 //- Data are contiguous if the data type is contiguous
236 template<class DataType>
237 struct is_contiguous<PointIntegrateData<DataType>>
238 :
239  is_contiguous<DataType>
240 {};
241 
242 
243 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
244 
245 } // End namespace Foam
246 
247 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
248 
249 #include "PointIntegrateDataI.H"
250 
251 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
252 
253 #endif
254 
255 // ************************************************************************* //
Foam::PointIntegrateData
Integrate along selected edges using PointEdgeWave.
Definition: PointIntegrateData.H:47
Foam::Tensor< scalar >
Foam::PointIntegrateData::data
const DataType & data() const
Definition: PointIntegrateData.H:99
Foam::PointIntegrateData::valid
bool valid(TrackingData &td) const
Changed or contains original (invalid) value.
Definition: PointIntegrateDataI.H:55
Foam::PointIntegrateData::enterDomain
void enterDomain(const polyPatch &patch, const label patchPointi, const point &pos, TrackingData &td)
Convert relative origin to absolute by adding entering point.
Definition: PointIntegrateDataI.H:89
Foam::PointIntegrateData::PointIntegrateData
PointIntegrateData()
Default construct.
Definition: PointIntegrateDataI.H:34
Foam::operator>>
Istream & operator>>(Istream &, directionInfo &)
Definition: directionInfo.C:230
Foam::PointIntegrateData::trackingData::trackingData
trackingData(UList< DataType > &edgeData)
Definition: PointIntegrateData.H:79
Foam::PointIntegrateData::operator==
bool operator==(const PointIntegrateData< DataType > &) const
Test for equality.
Definition: PointIntegrateDataI.H:247
Foam::PointIntegrateData::sameGeometry
bool sameGeometry(const PointIntegrateData< DataType > &, const scalar tol, TrackingData &td) const
Check for identical geometrical data (eg, cyclics checking)
Definition: PointIntegrateDataI.H:64
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
PointIntegrateDataI.H
Foam::PointIntegrateData::operator!=
bool operator!=(const PointIntegrateData< DataType > &) const
Test for inequality.
Definition: PointIntegrateDataI.H:257
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::PointIntegrateData::updateEdge
bool updateEdge(const polyMesh &mesh, const label edgeI, const label pointI, const PointIntegrateData< DataType > &pointInfo, const scalar tol, TrackingData &td)
Influence of point on edge.
Definition: PointIntegrateDataI.H:191
Foam::PointIntegrateData::transform
void transform(const tensor &rotTensor, TrackingData &td)
Apply rotation matrix to the data.
Definition: PointIntegrateDataI.H:101
Foam::PointIntegrateData::trackingData::edgeData_
UList< DataType > & edgeData_
Definition: PointIntegrateData.H:77
Foam::PointIntegrateData::equal
bool equal(const PointIntegrateData< DataType > &, TrackingData &td) const
Test for equality, with TrackingData.
Definition: PointIntegrateDataI.H:221
Foam::PointIntegrateData::updatePoint
bool updatePoint(const polyMesh &mesh, const label pointI, const label edgeI, const PointIntegrateData< DataType > &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on point.
Definition: PointIntegrateDataI.H:113
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::Vector< scalar >
Foam::UList< DataType >
Foam::PointIntegrateData::leaveDomain
void leaveDomain(const polyPatch &patch, const label patchPointi, const point &pos, TrackingData &td)
Definition: PointIntegrateDataI.H:77
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::PointIntegrateData::trackingData
Class used to pass extra data.
Definition: PointIntegrateData.H:73
Foam::point
vector point
Point is a vector.
Definition: point.H:43
Foam::PointIntegrateData::data
DataType & data()
Definition: PointIntegrateData.H:103
Foam::tensor
Tensor< scalar > tensor
Tensor of scalars, i.e. Tensor<scalar>.
Definition: symmTensor.H:61
Foam::data
Database for solution data, solver performance and other reduced data.
Definition: data.H:55
Foam::is_contiguous
A template class to specify that a data type can be considered as being contiguous in memory.
Definition: contiguous.H:75
Foam::pos
dimensionedScalar pos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:177