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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::directionalWallPointData
28 
29 Description
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 
36 SourceFiles
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 
49 namespace Foam
50 {
51 
52 template<class Type> class directionalWallPointData;
53 
54 // Forward declaration of friend functions and operators
55 
56 template<class Type> Istream&
58 template<class Type> Ostream&
60 
61 
62 /*---------------------------------------------------------------------------*\
63  Class directionalWallPointData Declaration
64 \*---------------------------------------------------------------------------*/
65 
66 template<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 
86 public:
87 
88  typedef Type dataType;
89 
90 
91  // Constructors
92 
93  //- Construct null
94  inline directionalWallPointData();
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
151 
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.
167 
168 template<> struct is_contiguous<directionalWallPointData<bool>> :
169 is_contiguous<wallPoint> {};
170 
171 template<> struct is_contiguous<directionalWallPointData<label>> :
172 is_contiguous_label<wallPoint> {};
173 
174 template<> struct is_contiguous<directionalWallPointData<scalar>> :
175 is_contiguous_scalar<wallPoint> {};
176 
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 
181 } // End namespace Foam
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 #ifdef NoRepository
186  #include "directionalWallPointData.C"
187 #endif
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 #endif
196 
197 // ************************************************************************* //
Foam::directionalWallPointData::updateCell
bool updateCell(const polyMesh &mesh, const label thisCelli, const label neighbourFacei, const directionalWallPointData< Type > &neighbourWallInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
Definition: directionalWallPointDataI.H:118
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::directionalWallPointData
Holds information (coordinate and normal) regarding the nearest wall point.
Definition: directionalWallPointData.H:51
directionalWallPointDataI.H
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::directionalWallPointData::directionalWallPointData
directionalWallPointData()
Construct null.
Definition: directionalWallPointDataI.H:93
wallPointData.H
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::directionalWallPointData::dataType
Type dataType
Definition: directionalWallPointData.H:87
Foam::Vector< scalar >
bool
bool
Definition: EEqn.H:20
Foam::wallPointData
Holds information (coordinate and normal) regarding nearest wall point.
Definition: wallPointData.H:52
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::directionalWallPointData::updateFace
bool updateFace(const polyMesh &mesh, const label thisFacei, const label neighbourCelli, const directionalWallPointData< Type > &neighbourWallInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
Definition: directionalWallPointDataI.H:143
directionalWallPointData.C
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