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 | Copyright (C) 2011-2016 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  //- Construct as copy
91  inline pointData(const pointData&);
92 
93 
94  // Member Functions
95 
96  // Access
97 
98  inline scalar s() const;
99 
100  inline const vector& v() const;
101 
102 
103  // Needed by meshWave
104 
105  //- Apply rotation matrix to origin
106  template<class TrackingData>
107  inline void transform
108  (
109  const tensor& rotTensor,
110  TrackingData& td
111  );
112 
113  //- Influence of edge on point
114  template<class TrackingData>
115  inline bool updatePoint
116  (
117  const polyMesh& mesh,
118  const label pointi,
119  const label edgeI,
120  const pointData& edgeInfo,
121  const scalar tol,
122  TrackingData& td
123  );
124 
125  //- Influence of different value on same point.
126  // Merge new and old info.
127  template<class TrackingData>
128  inline bool updatePoint
129  (
130  const polyMesh& mesh,
131  const label pointi,
132  const pointData& newPointInfo,
133  const scalar tol,
134  TrackingData& td
135  );
136 
137  //- Influence of different value on same point.
138  // No information about current position whatsoever.
139  template<class TrackingData>
140  inline bool updatePoint
141  (
142  const pointData& newPointInfo,
143  const scalar tol,
144  TrackingData& td
145  );
146 
147  //- Influence of point on edge.
148  template<class TrackingData>
149  inline bool updateEdge
150  (
151  const polyMesh& mesh,
152  const label edgeI,
153  const label pointi,
154  const pointData& pointInfo,
155  const scalar tol,
156  TrackingData& td
157  );
158 
159  // Member Operators
160 
161  // Needed for List IO
162  inline bool operator==(const pointData&) const;
163  inline bool operator!=(const pointData&) const;
164 
165 
166  // IOstream Operators
167 
168  friend Ostream& operator<<(Ostream&, const pointData&);
169  friend Istream& operator>>(Istream&, pointData&);
170 };
171 
172 
173 //- Data associated with pointData as contiguous as pointEdgePoint
174 template<>
175 inline bool contiguous<pointData>()
176 {
178 }
179 
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #include "pointDataI.H"
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 #endif
192 
193 // ************************************************************************* //
bool operator!=(const pointData &) const
Definition: pointDataI.H:230
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:80
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:93
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:184
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:32
const vector & v() const
Definition: pointDataI.H:72
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:174
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:220
Namespace for OpenFOAM.
scalar s() const
Definition: pointDataI.H:66
friend Ostream & operator<<(Ostream &, const pointData &)