wallNormalInfo.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::wallNormalInfo
26 
27 Description
28  Holds information regarding nearest wall point.
29  Used in wall refinement.
30 
31 SourceFiles
32  wallNormalInfoI.H
33  wallNormalInfo.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef wallNormalInfo_H
38 #define wallNormalInfo_H
39 
40 #include "point.H"
41 #include "label.H"
42 #include "scalar.H"
43 #include "tensor.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 // Forward declaration of classes
51 class polyPatch;
52 class polyMesh;
53 class transformer;
54 
55 
56 // Forward declaration of friend functions and operators
57 
58 class wallNormalInfo;
59 
60 Istream& operator>>(Istream&, wallNormalInfo&);
61 Ostream& operator<<(Ostream&, const wallNormalInfo&);
62 
63 
64 /*---------------------------------------------------------------------------*\
65  Class wallNormalInfo Declaration
66 \*---------------------------------------------------------------------------*/
67 
68 class wallNormalInfo
69 {
70  // Private Data
71 
72  //- Normal at nearest wall point
73  vector normal_;
74 
75  // Private Member Functions
76 
77  //- Evaluate distance to point. Update normal_
78  template<class TrackingData>
79  inline bool update(const wallNormalInfo& w2, TrackingData& td);
80 
81 public:
82 
83  // Constructors
84 
85  //- Construct null
86  inline wallNormalInfo();
87 
88  //- Construct from normal
89  inline wallNormalInfo(const vector& normal);
90 
91 
92  // Member Functions
93 
94  // Access
95 
96  inline const vector& normal() const;
97 
98 
99  // Needed by FaceCellWave
100 
101  //- Check whether origin has been changed at all or
102  // still contains original (invalid) value.
103  template<class TrackingData>
104  inline bool valid(TrackingData& td) const;
105 
106  //- Check for identical geometrical data. Used for cyclics checking.
107  template<class TrackingData>
108  inline bool sameGeometry
109  (
110  const polyMesh&,
111  const wallNormalInfo&,
112  const scalar,
113  TrackingData& td
114  ) const;
115 
116  //- Transform across an interface
117  template<class TrackingData>
118  inline void transform
119  (
120  const polyPatch& patch,
121  const label patchFacei,
122  const transformer& transform,
123  TrackingData& td
124  );
125 
126  //- Influence of neighbouring face.
127  template<class TrackingData>
128  inline bool updateCell
129  (
130  const polyMesh&,
131  const label thisCelli,
132  const label neighbourFacei,
133  const wallNormalInfo& neighbourInfo,
134  const scalar tol,
135  TrackingData& td
136  );
137 
138  //- Influence of neighbouring cell.
139  template<class TrackingData>
140  inline bool updateFace
141  (
142  const polyMesh&,
143  const label thisFacei,
144  const label neighbourCelli,
145  const wallNormalInfo& neighbourInfo,
146  const scalar tol,
147  TrackingData& td
148  );
149 
150  //- Influence of different value on same face.
151  template<class TrackingData>
152  inline bool updateFace
153  (
154  const polyMesh&,
155  const label thisFacei,
156  const wallNormalInfo& neighbourInfo,
157  const scalar tol,
158  TrackingData& td
159  );
160 
161  //- Same (like operator==)
162  template<class TrackingData>
163  inline bool equal(const wallNormalInfo&, TrackingData& td) const;
164 
165  // Member Operators
166 
167  // Needed for List IO
168  inline bool operator==(const wallNormalInfo&) const;
169 
170  inline bool operator!=(const wallNormalInfo&) const;
171 
172 
173  // IOstream Operators
174 
175  friend Ostream& operator<<(Ostream&, const wallNormalInfo&);
177 };
178 
179 
180 //- Data associated with wallNormalInfo type are contiguous
181 template<>
182 inline bool contiguous<wallNormalInfo>()
183 {
184  return true;
185 }
186 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 } // End namespace Foam
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #include "wallNormalInfoI.H"
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #endif
199 
200 // ************************************************************************* //
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space...
Definition: transformer.H:83
Holds information regarding nearest wall point. Used in wall refinement.
bool operator!=(const wallNormalInfo &) const
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
friend Ostream & operator<<(Ostream &, const wallNormalInfo &)
const vector & normal() const
#define w2
Definition: blockCreate.C:32
bool valid(TrackingData &td) const
Check whether origin has been changed at all or.
bool updateFace(const polyMesh &, const label thisFacei, const label neighbourCelli, const wallNormalInfo &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
bool contiguous< wallNormalInfo >()
Data associated with wallNormalInfo type are contiguous.
Istream & operator>>(Istream &, directionInfo &)
void transform(const polyPatch &patch, const label patchFacei, const transformer &transform, TrackingData &td)
Transform across an interface.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
bool equal(const wallNormalInfo &, TrackingData &td) const
Same (like operator==)
friend Istream & operator>>(Istream &, wallNormalInfo &)
wallNormalInfo()
Construct null.
bool operator==(const wallNormalInfo &) const
Ostream & operator<<(Ostream &, const ensightPart &)
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:76
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
bool updateCell(const polyMesh &, const label thisCelli, const label neighbourFacei, const wallNormalInfo &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
Namespace for OpenFOAM.
bool sameGeometry(const polyMesh &, const wallNormalInfo &, const scalar, TrackingData &td) const
Check for identical geometrical data. Used for cyclics checking.