directionalWallPointData.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) 2020 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::directionalWallPointData
28
29Description
30 Holds information (coordinate and normal) regarding the nearest wall point.
31
32 Variant of \c wallPointData that ignores the specified normal component
33 before comparing. This is used e.g. to find the distance to the wall
34 in the z-direction only.
35
36SourceFiles
37 directionalWallPointDataI.H
38 directionalWallPointData.C
39
40\*---------------------------------------------------------------------------*/
41
42#ifndef directionalWallPointData_H
43#define directionalWallPointData_H
44
45#include "wallPointData.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52template<class Type> class directionalWallPointData;
53
54// Forward declaration of friend functions and operators
55
56template<class Type> Istream&
57operator>>(Istream&, directionalWallPointData<Type>&);
58template<class Type> Ostream&
59operator<<(Ostream&, const directionalWallPointData<Type>&);
60
61
62/*---------------------------------------------------------------------------*\
63 Class directionalWallPointData Declaration
64\*---------------------------------------------------------------------------*/
65
66template<class Type>
68:
69 public wallPointData<Type>
70{
71 // Private Member Functions
72
73 //- Evaluate distance to point. Update distSqr, origin from whomever
74 // is nearer pt. Return true if w2 is closer to point,
75 // false otherwise.
76 template<class TrackingData>
77 inline bool update
78 (
79 const point&,
81 const scalar tol,
82 TrackingData& td
83 );
84
85
86public:
88 typedef Type dataType;
89
90
91 // Constructors
92
93 //- Construct null
95
96 //- Construct from origin, normal, distance
98 (
99 const point& origin,
100 const Type& data,
101 const scalar distSqr
102 );
103
104
105 // Member Functions
106
107 // Needed by meshWave
108
109 //- Influence of neighbouring face.
110 // Calls update(...) with cellCentre of celli
111 template<class TrackingData>
112 inline bool updateCell
113 (
114 const polyMesh& mesh,
115 const label thisCelli,
116 const label neighbourFacei,
117 const directionalWallPointData<Type>& neighbourWallInfo,
118 const scalar tol,
119 TrackingData& td
120 );
121
122 //- Influence of neighbouring cell.
123 // Calls update(...) with faceCentre of facei
124 template<class TrackingData>
125 inline bool updateFace
126 (
127 const polyMesh& mesh,
128 const label thisFacei,
129 const label neighbourCelli,
130 const directionalWallPointData<Type>& neighbourWallInfo,
131 const scalar tol,
132 TrackingData& td
133 );
134
135 //- Influence of different value on same face.
136 // Merge new and old info.
137 // Calls update(...) with faceCentre of facei
138 template<class TrackingData>
139 inline bool updateFace
140 (
141 const polyMesh& mesh,
142 const label thisFacei,
143 const directionalWallPointData<Type>& neighbourWallInfo,
144 const scalar tol,
145 TrackingData& td
146 );
147
148 // Member Operators
149
150 // IOstream Operators
152 friend Ostream& operator<< <Type>
153 (
154 Ostream&,
156 );
157 friend Istream& operator>> <Type>
158 (
159 Istream&,
161 );
162};
163
164
165// Data associated with directionalWallPointData type are contiguous. List the
166// usual ones.
168template<> struct is_contiguous<directionalWallPointData<bool>> :
169is_contiguous<wallPoint> {};
171template<> struct is_contiguous<directionalWallPointData<label>> :
172is_contiguous_label<wallPoint> {};
174template<> struct is_contiguous<directionalWallPointData<scalar>> :
175is_contiguous_scalar<wallPoint> {};
176
177
178// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179
180
181} // End namespace Foam
182
183// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184
185#ifdef NoRepository
187#endif
188
189// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190
192
193// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194
195#endif
196
197// ************************************************************************* //
#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
Holds information (coordinate and normal) regarding the nearest wall point.
bool updateFace(const polyMesh &mesh, const label thisFacei, const label neighbourCelli, const directionalWallPointData< Type > &neighbourWallInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
bool updateCell(const polyMesh &mesh, const label thisCelli, const label neighbourFacei, const directionalWallPointData< Type > &neighbourWallInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Holds information (coordinate and normal) regarding nearest wall point.
Definition: wallPointData.H:66
const point & origin() const
Definition: wallPoint.H:106
scalar distSqr() const
Definition: wallPoint.H:115
bool
Definition: EEqn.H:20
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