pointData.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2022 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 Class
25  Foam::pointData
26 
27 Description
28  Variant of pointEdgePoint with some transported additional data.
29  WIP - should be templated on data like wallPointData.
30 
31 SourceFiles
32  pointDataI.H
33  pointData.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef pointData_H
38 #define pointData_H
39 
40 #include "pointEdgePoint.H"
41 
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declaration of friend functions and operators
49 
50 class pointData;
51 class transformer;
52 
53 Istream& operator>>(Istream&, pointData&);
54 Ostream& operator<<(Ostream&, const pointData&);
55 
56 
57 /*---------------------------------------------------------------------------*\
58  Class pointData Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 class pointData
62 :
63  public pointEdgePoint
64 {
65  // Private Data
66 
67  //- Additional information.
68  scalar s_;
69 
70  //- Additional information.
71  vector v_;
72 
73 public:
74 
75  // Constructors
76 
77  //- Construct null
78  inline pointData();
79 
80  //- Construct from origin, distance
81  inline pointData
82  (
83  const point& origin,
84  const scalar distSqr,
85  const scalar s,
86  const vector& v
87  );
88 
89 
90  // Member Functions
91 
92  // Access
93 
94  inline scalar s() const;
95 
96  inline const vector& v() const;
97 
98 
99  // Needed by meshWave
100 
101  //- Transform across an interface
102  template<class TrackingData>
103  inline void transform
104  (
105  const polyPatch& patch,
106  const label patchFacei,
107  const transformer& transform,
108  TrackingData& td
109  );
110 
111  //- Influence of edge on point
112  template<class TrackingData>
113  inline bool updatePoint
114  (
115  const polyMesh& mesh,
116  const label pointi,
117  const label edgei,
118  const pointData& edgeinfo,
119  const scalar tol,
120  TrackingData& td
121  );
122 
123  //- Influence of different value on same point.
124  // Merge new and old info.
125  template<class TrackingData>
126  inline bool updatePoint
127  (
128  const polyMesh& mesh,
129  const label pointi,
130  const pointData& newPointInfo,
131  const scalar tol,
132  TrackingData& td
133  );
134 
135  //- Influence of different value on same point.
136  // No information about current position whatsoever.
137  template<class TrackingData>
138  inline bool updatePoint
139  (
140  const pointData& newPointInfo,
141  const scalar tol,
142  TrackingData& td
143  );
144 
145  //- Influence of point on edge.
146  template<class TrackingData>
147  inline bool updateEdge
148  (
149  const polyMesh& mesh,
150  const label edgei,
151  const label pointi,
152  const pointData& pointInfo,
153  const scalar tol,
154  TrackingData& td
155  );
156 
157  // Member Operators
158 
159  // Needed for List IO
160  inline bool operator==(const pointData&) const;
161  inline bool operator!=(const pointData&) const;
162 
163 
164  // IOstream Operators
165 
166  friend Ostream& operator<<(Ostream&, const pointData&);
167  friend Istream& operator>>(Istream&, pointData&);
168 };
169 
170 
171 //- Data associated with pointData as contiguous as pointEdgePoint
172 template<>
173 inline bool contiguous<pointData>()
174 {
176 }
177 
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 } // End namespace Foam
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 #include "pointDataI.H"
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #endif
190 
191 // ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
Variant of pointEdgePoint with some transported additional data. WIP - should be templated on data li...
Definition: pointData.H:63
pointData()
Construct null.
Definition: pointDataI.H:31
bool updateEdge(const polyMesh &mesh, const label edgei, const label pointi, const pointData &pointInfo, const scalar tol, TrackingData &td)
Influence of point on edge.
Definition: pointDataI.H:175
const vector & v() const
Definition: pointDataI.H:61
friend Istream & operator>>(Istream &, pointData &)
bool updatePoint(const polyMesh &mesh, const label pointi, const label edgei, const pointData &edgeinfo, const scalar tol, TrackingData &td)
Influence of edge on point.
Definition: pointDataI.H:84
bool operator==(const pointData &) const
Definition: pointDataI.H:211
friend Ostream & operator<<(Ostream &, const pointData &)
void transform(const polyPatch &patch, const label patchFacei, const transformer &transform, TrackingData &td)
Transform across an interface.
Definition: pointDataI.H:69
bool operator!=(const pointData &) const
Definition: pointDataI.H:221
scalar s() const
Definition: pointDataI.H:55
Holds information regarding nearest wall point. Used in PointEdgeWave. (so not standard FaceCellWave)...
scalar distSqr() const
const point & origin() const
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:70
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space.
Definition: transformer.H:84
Namespace for OpenFOAM.
bool contiguous< pointEdgePoint >()
Data associated with pointEdgePoint type are contiguous.
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
bool contiguous< pointData >()
Data associated with pointData as contiguous as pointEdgePoint.
Definition: pointData.H:172
Istream & operator>>(Istream &, directionInfo &)
Ostream & operator<<(Ostream &, const ensightPart &)