wallPointData.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-2016 OpenFOAM Foundation
9  Copyright (C) 2019-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::wallPointData
29 
30 Description
31  Holds information (coordinate and normal) regarding nearest wall point.
32 
33  Is like wallPoint but transfer extra (passive) data.
34  Used e.g. in wall distance calculation with wall reflection vectors.
35 
36 SourceFiles
37  wallPointDataI.H
38  wallPointData.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef wallPointData_H
43 #define wallPointData_H
44 
45 #include "wallPoint.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 // Forward Declarations
53 template<class Type> class wallPointData;
54 
55 template<class Type> Istream& operator>>(Istream&, wallPointData<Type>&);
56 template<class Type> Ostream& operator<<(Ostream&, const wallPointData<Type>&);
57 
58 
59 /*---------------------------------------------------------------------------*\
60  Class wallPointData Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 template<class Type>
64 class wallPointData
65 :
66  public wallPoint
67 {
68  // Private Data
69 
70  //- Data at nearest wall center
71  Type data_;
72 
73 
74  // Private Member Functions
75 
76  //- Evaluate distance to point.
77  // Update distSqr, origin from whomever is nearer pt.
78  // \return true if w2 is closer to point, false otherwise.
79  template<class TrackingData>
80  inline bool update
81  (
82  const point&,
83  const wallPointData<Type>& w2,
84  const scalar tol,
85  TrackingData& td
86  );
87 
88 
89 public:
90 
91  // Public Typedefs
92 
93  //- Type of additional data carried
94  typedef Type dataType;
95 
96 
97  // Constructors
98 
99  //- Default construct
100  inline wallPointData();
101 
102  //- Construct from origin, normal, distance
103  inline wallPointData
104  (
105  const point& origin,
106  const Type& data,
107  const scalar distSqr
108  );
109 
110 
111  // Member Functions
112 
113  // Access
114 
115  const Type& data() const
116  {
117  return data_;
118  }
119  Type& data()
120  {
121  return data_;
122  }
123 
124 
125  // Needed by MeshWave
126 
127  //- Influence of neighbouring face.
128  // Calls update(...) with cellCentre of celli
129  template<class TrackingData>
130  inline bool updateCell
131  (
132  const polyMesh& mesh,
133  const label thisCelli,
134  const label neighbourFacei,
135  const wallPointData<Type>& neighbourWallInfo,
136  const scalar tol,
137  TrackingData& td
138  );
139 
140  //- Influence of neighbouring cell.
141  // Calls update(...) with faceCentre of facei
142  template<class TrackingData>
143  inline bool updateFace
144  (
145  const polyMesh& mesh,
146  const label thisFacei,
147  const label neighbourCelli,
148  const wallPointData<Type>& neighbourWallInfo,
149  const scalar tol,
150  TrackingData& td
151  );
152 
153  //- Influence of different value on same face.
154  // Merge new and old info.
155  // Calls update(...) with faceCentre of facei
156  template<class TrackingData>
157  inline bool updateFace
158  (
159  const polyMesh& mesh,
160  const label thisFacei,
161  const wallPointData<Type>& neighbourWallInfo,
162  const scalar tol,
163  TrackingData& td
164  );
165 
166 
167  // IOstream Operators
168 
169  friend Ostream& operator<< <Type>(Ostream&, const wallPointData<Type>&);
170  friend Istream& operator>> <Type>(Istream&, wallPointData<Type>&);
171 };
172 
173 
174 // * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
175 
176 //- Data are contiguous if data type is contiguous
177 template<class Type>
178 struct is_contiguous<wallPointData<Type>> : is_contiguous<Type> {};
179 
180 //- Data are contiguous label if data type is label
181 template<class Type>
182 struct is_contiguous_label<wallPointData<Type>> : is_contiguous_label<Type> {};
183 
184 //- Data are contiguous scalar if data type is scalar
185 template<class Type>
187 
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 } // End namespace Foam
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 #ifdef NoRepository
196  #include "wallPointData.C"
197 #endif
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #include "wallPointDataI.H"
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #endif
206 
207 // ************************************************************************* //
Foam::wallPoint
Holds information regarding nearest wall point. Used in wall distance calculation.
Definition: wallPoint.H:65
wallPoint.H
Foam::wallPointData::wallPointData
wallPointData()
Default construct.
Definition: wallPointDataI.H:76
wallPointData.C
Foam::operator>>
Istream & operator>>(Istream &, directionInfo &)
Definition: directionInfo.C:230
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::is_contiguous_label
A template class to specify if a data type is composed solely of Foam::label elements.
Definition: contiguous.H:83
Foam::wallPointData::updateFace
bool updateFace(const polyMesh &mesh, const label thisFacei, const label neighbourCelli, const wallPointData< Type > &neighbourWallInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
Definition: wallPointDataI.H:127
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::wallPointData::data
const Type & data() const
Definition: wallPointData.H:114
Foam::wallPointData::updateCell
bool updateCell(const polyMesh &mesh, const label thisCelli, const label neighbourFacei, const wallPointData< Type > &neighbourWallInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
Definition: wallPointDataI.H:102
w2
#define w2
Definition: blockCreate.C:35
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::is_contiguous_scalar
A template class to specify if a data type is composed solely of Foam::scalar elements.
Definition: contiguous.H:91
Foam::wallPointData::dataType
Type dataType
Type of additional data carried.
Definition: wallPointData.H:93
Foam::Vector< scalar >
Foam::wallPointData
Holds information (coordinate and normal) regarding nearest wall point.
Definition: wallPointData.H:52
Foam::wallPointData::data
Type & data()
Definition: wallPointData.H:118
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
wallPointDataI.H
Foam::data
Database for solution data, solver performance and other reduced data.
Definition: data.H:55
Foam::is_contiguous
A template class to specify that a data type can be considered as being contiguous in memory.
Definition: contiguous.H:75