wallFace.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2022 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::wallFace
26 
27 Description
28  Holds information regarding nearest wall point. Used in wall distance
29  calculation.
30 
31 SourceFiles
32  wallFaceI.H
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef wallFace_H
37 #define wallFace_H
38 
39 #include "pointField.H"
40 #include "face.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // Forward declaration of classes
48 class polyPatch;
49 class polyMesh;
50 class transformer;
51 
52 // Forward declaration of friend functions and operators
53 template<class Derived>
54 class WallFaceBase;
55 template<class Derived>
56 Ostream& operator<<(Ostream&, const WallFaceBase<Derived>&);
57 template<class Derived>
59 
60 /*---------------------------------------------------------------------------*\
61  Class WallFaceBase Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 template<class Derived>
65 class WallFaceBase
66 {
67  // Private Data
68 
69  //- Face points
70  pointField points_;
71 
72  //- Normal distance (squared) from cell center to face
73  scalar distSqr_;
74 
75 
76 protected:
77 
78  // Protected Member Functions
79 
80  //- ...
81  template<class TrackingData>
82  inline bool update
83  (
84  const point& pt,
86  const scalar tol,
87  TrackingData& td
88  );
89 
90 
91 public:
92 
93  // Constructors
94 
95  //- Construct null
96  inline WallFaceBase();
97 
98  //- Construct from face, distance
99  inline WallFaceBase
100  (
101  const face& f,
102  const pointField& points,
103  const scalar distSqr
104  );
105 
106  //- Construct from face, distance
107  inline WallFaceBase
108  (
109  const face& f,
110  const pointField& points,
111  const point& centre,
112  const scalar distSqr
113  );
114 
115 
116  // Member Functions
117 
118  // Access
119 
120  inline const pointField& points() const;
121 
122  inline pointField& points();
123 
124  inline scalar distSqr() const;
125 
126  inline scalar& distSqr();
127 
128  template<class TrackingData>
129  inline scalar dist(TrackingData& td) const;
130 
131 
132  // Needed by FaceCellWave
133 
134  //- Check whether the WallFaceBase has been changed at all or still
135  // contains original (invalid) value.
136  template<class TrackingData>
137  inline bool valid(TrackingData& td) const;
138 
139  //- Check for identical geometrical data. Used for checking
140  // consistency across cyclics.
141  template<class TrackingData>
142  inline bool sameGeometry
143  (
144  const polyMesh&,
145  const WallFaceBase<Derived>&,
146  const scalar,
147  TrackingData& td
148  ) const;
149 
150  //- Transform across an interface
151  template<class TrackingData>
152  inline void transform
153  (
154  const polyPatch& patch,
155  const label patchFacei,
156  const transformer& transform,
157  TrackingData& td
158  );
159 
160  //- Influence of neighbouring face
161  template<class TrackingData>
162  inline bool updateCell
163  (
164  const polyMesh&,
165  const label thisCelli,
166  const label neighbourFacei,
167  const WallFaceBase<Derived>& neighbourInfo,
168  const scalar tol,
169  TrackingData& td
170  );
171 
172  //- Influence of neighbouring cell
173  template<class TrackingData>
174  inline bool updateFace
175  (
176  const polyMesh&,
177  const label thisFacei,
178  const label neighbourCelli,
179  const WallFaceBase<Derived>& neighbourInfo,
180  const scalar tol,
181  TrackingData& td
182  );
183 
184  //- Influence of different value on same face
185  template<class TrackingData>
186  inline bool updateFace
187  (
188  const polyMesh&,
189  const label thisFacei,
190  const WallFaceBase<Derived>& neighbourInfo,
191  const scalar tol,
192  TrackingData& td
193  );
194 
195  //- Test equality
196  template<class TrackingData>
197  inline bool equal
198  (
199  const WallFaceBase<Derived>&,
200  TrackingData& td
201  ) const;
202 
203 
204  // Member Operators
205 
206  inline bool operator==(const WallFaceBase<Derived>&) const;
207  inline bool operator!=(const WallFaceBase<Derived>&) const;
208 
209 
210  // IOstream Operators
211 
212  friend Ostream& operator<< <Derived>
213  (
214  Ostream&,
215  const WallFaceBase<Derived>&
216  );
217 
218  friend Istream& operator>> <Derived>
219  (
220  Istream&,
222  );
223 };
224 
225 /*---------------------------------------------------------------------------*\
226  Class wallFace Declaration
227 \*---------------------------------------------------------------------------*/
229 class wallFace
230 :
231  public WallFaceBase<wallFace>
232 {
233  public:
234 
237  template<class Derived> using type = WallFaceBase<Derived>;
238 };
239 
240 
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 
243 } // End namespace Foam
244 
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246 
247 #include "wallFaceI.H"
248 
249 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
250 
251 #endif
252 
253 // ************************************************************************* //
const pointField & points() const
Definition: wallFaceI.H:115
WallFaceBase()
Construct null.
Definition: wallFaceI.H:78
bool equal(const WallFaceBase< Derived > &, TrackingData &td) const
Test equality.
Definition: wallFaceI.H:273
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space...
Definition: transformer.H:83
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:75
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
bool operator==(const WallFaceBase< Derived > &) const
Definition: wallFaceI.H:286
#define w2
Definition: blockCreate.C:32
bool sameGeometry(const polyMesh &, const WallFaceBase< Derived > &, const scalar, TrackingData &td) const
Check for identical geometrical data. Used for checking.
Definition: wallFaceI.H:161
void transform(const polyPatch &patch, const label patchFacei, const transformer &transform, TrackingData &td)
Transform across an interface.
Definition: wallFaceI.H:191
scalar distSqr() const
Definition: wallFaceI.H:129
Istream & operator>>(Istream &, directionInfo &)
bool operator!=(const WallFaceBase< Derived > &) const
Definition: wallFaceI.H:296
scalar dist(TrackingData &td) const
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
bool valid(TrackingData &td) const
Check whether the WallFaceBase has been changed at all or still.
Definition: wallFaceI.H:152
labelList f(nPoints)
Holds information regarding nearest wall point. Used in wall distance calculation.
Definition: wallFace.H:228
bool updateFace(const polyMesh &, const label thisFacei, const label neighbourCelli, const WallFaceBase< Derived > &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
Definition: wallFaceI.H:228
bool updateCell(const polyMesh &, const label thisCelli, const label neighbourFacei, const WallFaceBase< Derived > &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
Definition: wallFaceI.H:205
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:76
bool update(const point &pt, const WallFaceBase< Derived > &w2, const scalar tol, TrackingData &td)
...
Definition: wallFaceI.H:35
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Namespace for OpenFOAM.