PointData.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-2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::PointData
29
30Description
31 Variant of pointEdgePoint with some transported additional data. Templated
32 on the transported data type.
33
34SourceFiles
35 PointDataI.H
36 PointData.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef PointData_H
41#define PointData_H
42
43#include "pointEdgePoint.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50// Forward Declarations
51class Istream;
52class Ostream;
53template<class DataType> class PointData;
54
55template<class DataType>
57template<class DataType>
59
60/*---------------------------------------------------------------------------*\
61 Class PointData Declaration
62\*---------------------------------------------------------------------------*/
63
64template<class DataType>
65class PointData
66:
67 public pointEdgePoint
68{
69 // Private Data
70
71 //- Additional transported data
72 DataType data_;
73
74
75public:
76
77 // Constructors
78
79 //- Default construct
80 inline PointData();
81
82 //- Construct from origin, distance and data
83 inline PointData
84 (
85 const point& origin,
86 const scalar distSqr,
87 const DataType& data
88 );
89
90
91 // Member Functions
92
93 // Access
95 const DataType& data() const
96 {
97 return data_;
98 }
99 DataType& data()
100 {
101 return data_;
102 }
103
104
105 // Needed by MeshWave
106
107 //- Apply rotation matrix to the data
108 template<class TrackingData>
109 inline void transform
110 (
111 const tensor& rotTensor,
112 TrackingData& td
113 );
114
115 //- Influence of edge on point
116 template<class TrackingData>
117 inline bool updatePoint
118 (
119 const polyMesh& mesh,
120 const label pointI,
121 const label edgeI,
122 const PointData<DataType>& edgeInfo,
123 const scalar tol,
124 TrackingData& td
125 );
126
127 //- Influence of different value on same point.
128 // Merge new and old info.
129 template<class TrackingData>
130 inline bool updatePoint
131 (
132 const polyMesh& mesh,
133 const label pointI,
134 const PointData<DataType>& newPointInfo,
135 const scalar tol,
136 TrackingData& td
137 );
138
139 //- Influence of different value on same point.
140 // No information about current position whatsoever.
141 template<class TrackingData>
142 inline bool updatePoint
143 (
144 const PointData<DataType>& newPointInfo,
145 const scalar tol,
146 TrackingData& td
147 );
148
149 //- Influence of point on edge.
150 template<class TrackingData>
151 inline bool updateEdge
152 (
153 const polyMesh& mesh,
154 const label edgeI,
155 const label pointI,
156 const PointData<DataType>& pointInfo,
157 const scalar tol,
158 TrackingData& td
159 );
160
161
162 // Member Operators
163
164 //- Test for equality
165 inline bool operator==(const PointData<DataType>&) const;
166
167 //- Test for inequality
168 inline bool operator!=(const PointData<DataType>&) const;
169
170
171 // IOstream Operators
173 friend Ostream& operator<< <DataType>
174 (
175 Ostream&,
177 );
178 friend Istream& operator>> <DataType>
179 (
180 Istream&,
182 );
183};
184
185
186// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
187
188//- Data are contiguous if data type is contiguous
189template<class DataType>
190struct is_contiguous<PointData<DataType>> : is_contiguous<DataType> {};
191
192//- Contiguous scalar only when data type is also scalar
193template<class DataType>
194struct is_contiguous_scalar<PointData<DataType>>
195:
196 is_contiguous_scalar<DataType>
197{};
198
199
200// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201
202} // End namespace Foam
203
204// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205
206#include "PointDataI.H"
207
208#ifdef NoRepository
209# include "PointData.C"
210#endif
211
212// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213
214#endif
215
216// ************************************************************************* //
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
Variant of pointEdgePoint with some transported additional data. Templated on the transported data ty...
Definition: PointData.H:67
bool operator!=(const PointData< DataType > &) const
Test for inequality.
Definition: PointDataI.H:204
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:158
DataType & data()
Definition: PointData.H:98
void transform(const tensor &rotTensor, TrackingData &td)
Apply rotation matrix to the data.
Definition: PointDataI.H:59
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:72
bool operator==(const PointData< DataType > &) const
Test for equality.
Definition: PointDataI.H:194
PointData()
Default construct.
Definition: PointDataI.H:35
const DataType & data() const
Definition: PointData.H:94
Database for solution data, solver performance and other reduced data.
Definition: data.H:58
Holds information regarding nearest wall point. Used in PointEdgeWave. (so not standard FaceCellWave)...
const point & origin() const
scalar distSqr() const
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Tensor of scalars, i.e. Tensor<scalar>.
dynamicFvMesh & mesh
Namespace for OpenFOAM.
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 if a data type is composed solely of Foam::scalar elements.
Definition: contiguous.H:94
A template class to specify that a data type can be considered as being contiguous in memory.
Definition: contiguous.H:78