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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::wallPointData
29
30Description
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
36SourceFiles
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
49namespace Foam
50{
51
52// Forward Declarations
53template<class Type> class wallPointData;
56template<class Type> Ostream& operator<<(Ostream&, const wallPointData<Type>&);
57
58
59/*---------------------------------------------------------------------------*\
60 Class wallPointData Declaration
61\*---------------------------------------------------------------------------*/
62
63template<class Type>
64class 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&,
84 const scalar tol,
85 TrackingData& td
86 );
87
88
89public:
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
115 const Type& data() const
116 {
117 return data_;
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
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
177template<class Type>
178struct is_contiguous<wallPointData<Type>> : is_contiguous<Type> {};
179
180//- Data are contiguous label if data type is label
181template<class Type>
183
184//- Data are contiguous scalar if data type is scalar
185template<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// ************************************************************************* //
#define w2
Definition: blockCreate.C:35
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Database for solution data, solver performance and other reduced data.
Definition: data.H:58
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Holds information (coordinate and normal) regarding nearest wall point.
Definition: wallPointData.H:66
Type dataType
Type of additional data carried.
Definition: wallPointData.H:93
bool updateCell(const polyMesh &mesh, const label thisCelli, const label neighbourFacei, const wallPointData< Type > &neighbourWallInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
wallPointData()
Default construct.
bool updateFace(const polyMesh &mesh, const label thisFacei, const label neighbourCelli, const wallPointData< Type > &neighbourWallInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
const Type & data() const
Holds information regarding nearest wall point. Used in wall distance calculation.
Definition: wallPoint.H:66
const point & origin() const
Definition: wallPoint.H:106
scalar distSqr() const
Definition: wallPoint.H:115
mesh update()
dynamicFvMesh & mesh
Namespace for OpenFOAM.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Istream & operator>>(Istream &, directionInfo &)
A template class to specify if a data type is composed solely of Foam::label elements.
Definition: contiguous.H:86
A template class to specify if a data type is composed solely of Foam::scalar elements.
Definition: contiguous.H:94
A template class to specify that a data type can be considered as being contiguous in memory.
Definition: contiguous.H:78