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