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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::PointIntegrateData
28
29Description
30 Integrate along selected edges using PointEdgeWave.
31
32SourceFiles
33 PointIntegrateDataI.H
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef PointIntegrateData_H
38#define PointIntegrateData_H
39
40// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41
42namespace Foam
43{
44
45// Forward Declarations
46class Istream;
47class Ostream;
48template<class DataType> class PointIntegrateData;
49
50template<class DataType>
52template<class DataType>
54
55/*---------------------------------------------------------------------------*\
56 Class PointIntegrateData declaration
57\*---------------------------------------------------------------------------*/
58
59template<class DataType>
61{
62 // Private Data
63
64 //- Valid flag
65 bool valid_;
66
67 //- Integrated data
68 DataType data_;
69
70
71public:
72
73 //- Class used to pass extra data
74 class trackingData
75 {
76 public:
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
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
220 friend Ostream& operator<< <DataType>
221 (
222 Ostream&,
224 );
225 friend Istream& operator>> <DataType>
226 (
227 Istream&,
229 );
230};
231
232
233// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
234
235//- Data are contiguous if the data type is contiguous
236template<class DataType>
237struct 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// ************************************************************************* //
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
Class used to pass extra data.
trackingData(UList< DataType > &edgeData)
Integrate along selected edges using PointEdgeWave.
bool equal(const PointIntegrateData< DataType > &, TrackingData &td) const
Test for equality, with TrackingData.
void leaveDomain(const polyPatch &patch, const label patchPointi, const point &pos, TrackingData &td)
bool operator==(const PointIntegrateData< DataType > &) const
Test for equality.
void transform(const tensor &rotTensor, TrackingData &td)
Apply rotation matrix to the data.
void enterDomain(const polyPatch &patch, const label patchPointi, const point &pos, TrackingData &td)
Convert relative origin to absolute by adding entering point.
bool valid(TrackingData &td) const
Changed or contains original (invalid) value.
bool operator!=(const PointIntegrateData< DataType > &) const
Test for inequality.
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.
PointIntegrateData()
Default construct.
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.
const DataType & data() const
bool sameGeometry(const PointIntegrateData< DataType > &, const scalar tol, TrackingData &td) const
Check for identical geometrical data (eg, cyclics checking)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: UList.H:94
Database for solution data, solver performance and other reduced data.
Definition: data.H:58
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
Tensor of scalars, i.e. Tensor<scalar>.
dynamicFvMesh & mesh
Namespace for OpenFOAM.
dimensionedScalar pos(const dimensionedScalar &ds)
vector point
Point is a vector.
Definition: point.H:43
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Istream & operator>>(Istream &, directionInfo &)
A template class to specify that a data type can be considered as being contiguous in memory.
Definition: contiguous.H:78