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-2019 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 wallDistData.
30  Passive vector v_ is not a coordinate (so no enterDomain/leaveDomain
31  transformation needed)
32 
33 SourceFiles
34  pointDataI.H
35  pointData.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef pointData_H
40 #define pointData_H
41 
42 #include "pointEdgePoint.H"
43 
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 // Forward declaration of friend functions and operators
51 
52 class pointData;
53 
54 Istream& operator>>(Istream&, pointData&);
55 Ostream& operator<<(Ostream&, const pointData&);
56 
57 
58 /*---------------------------------------------------------------------------*\
59  Class pointData Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class pointData
63 :
64  public pointEdgePoint
65 {
66  // Private Data
67 
68  //- Additional information.
69  scalar s_;
70 
71  //- Additional information.
72  vector v_;
73 
74 public:
75 
76  // Constructors
77 
78  //- Construct null
79  inline pointData();
80 
81  //- Construct from origin, distance
82  inline pointData
83  (
84  const point& origin,
85  const scalar distSqr,
86  const scalar s,
87  const vector& v
88  );
89 
90 
91  // Member Functions
92 
93  // Access
94 
95  inline scalar s() const;
96 
97  inline const vector& v() const;
98 
99 
100  // Needed by meshWave
101 
102  //- Apply rotation matrix to origin
103  template<class TrackingData>
104  inline void transform
105  (
106  const tensor& rotTensor,
107  TrackingData& td
108  );
109 
110  //- Influence of edge on point
111  template<class TrackingData>
112  inline bool updatePoint
113  (
114  const polyMesh& mesh,
115  const label pointi,
116  const label edgeI,
117  const pointData& edgeInfo,
118  const scalar tol,
119  TrackingData& td
120  );
121 
122  //- Influence of different value on same point.
123  // Merge new and old info.
124  template<class TrackingData>
125  inline bool updatePoint
126  (
127  const polyMesh& mesh,
128  const label pointi,
129  const pointData& newPointInfo,
130  const scalar tol,
131  TrackingData& td
132  );
133 
134  //- Influence of different value on same point.
135  // No information about current position whatsoever.
136  template<class TrackingData>
137  inline bool updatePoint
138  (
139  const pointData& newPointInfo,
140  const scalar tol,
141  TrackingData& td
142  );
143 
144  //- Influence of point on edge.
145  template<class TrackingData>
146  inline bool updateEdge
147  (
148  const polyMesh& mesh,
149  const label edgeI,
150  const label pointi,
151  const pointData& pointInfo,
152  const scalar tol,
153  TrackingData& td
154  );
155 
156  // Member Operators
157 
158  // Needed for List IO
159  inline bool operator==(const pointData&) const;
160  inline bool operator!=(const pointData&) const;
161 
162 
163  // IOstream Operators
164 
165  friend Ostream& operator<<(Ostream&, const pointData&);
166  friend Istream& operator>>(Istream&, pointData&);
167 };
168 
169 
170 //- Data associated with pointData as contiguous as pointEdgePoint
171 template<>
172 inline bool contiguous<pointData>()
173 {
175 }
176 
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 } // End namespace Foam
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 #include "pointDataI.H"
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #endif
189 
190 // ************************************************************************* //
bool operator!=(const pointData &) const
Definition: pointDataI.H:219
Variant of pointEdgePoint with some transported additional data. WIP - should be templated on data li...
Definition: pointData.H:61
void transform(const tensor &rotTensor, TrackingData &td)
Apply rotation matrix to origin.
Definition: pointDataI.H:69
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:82
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 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:173
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
const point & origin() const
bool contiguous< pointEdgePoint >()
Data associated with pointEdgePoint type are contiguous.
friend Istream & operator>>(Istream &, pointData &)
scalar distSqr() const
pointData()
Construct null.
Definition: pointDataI.H:31
const vector & v() const
Definition: pointDataI.H:61
dynamicFvMesh & mesh
Istream & operator>>(Istream &, directionInfo &)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
bool contiguous< pointData >()
Data associated with pointData as contiguous as pointEdgePoint.
Definition: pointData.H:171
Ostream & operator<<(Ostream &, const ensightPart &)
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Holds information regarding nearest wall point. Used in PointEdgeWave. (so not standard FaceCellWave)...
bool operator==(const pointData &) const
Definition: pointDataI.H:209
Namespace for OpenFOAM.
scalar s() const
Definition: pointDataI.H:55
friend Ostream & operator<<(Ostream &, const pointData &)