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-2018 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 
54 
55 // Forward declaration of friend functions and operators
56 
57 class wallNormalInfo;
58 
59 Istream& operator>>(Istream&, wallNormalInfo&);
60 Ostream& operator<<(Ostream&, const wallNormalInfo&);
61 
62 
63 /*---------------------------------------------------------------------------*\
64  Class wallNormalInfo Declaration
65 \*---------------------------------------------------------------------------*/
66 
67 class wallNormalInfo
68 {
69  // Private data
70 
71  //- Normal at nearest wall point
72  vector normal_;
73 
74  // Private Member Functions
75 
76  //- Evaluate distance to point. Update normal_
77  template<class TrackingData>
78  inline bool update(const wallNormalInfo& w2, TrackingData& td);
79 
80 public:
81 
82  // Constructors
83 
84  //- Construct null
85  inline wallNormalInfo();
86 
87  //- Construct from normal
88  inline wallNormalInfo(const vector& normal);
89 
90  //- Construct as copy
91  inline wallNormalInfo(const wallNormalInfo&);
92 
93  // Member Functions
94 
95  // Access
96 
97  inline const vector& normal() const;
98 
99 
100  // Needed by FaceCellWave
101 
102  //- Check whether origin has been changed at all or
103  // still contains original (invalid) value.
104  template<class TrackingData>
105  inline bool valid(TrackingData& td) const;
106 
107  //- Check for identical geometrical data. Used for cyclics checking.
108  template<class TrackingData>
109  inline bool sameGeometry
110  (
111  const polyMesh&,
112  const wallNormalInfo&,
113  const scalar,
114  TrackingData& td
115  ) const;
116 
117  //- Convert any absolute coordinates into relative to (patch)face
118  // centre
119  template<class TrackingData>
120  inline void leaveDomain
121  (
122  const polyMesh&,
123  const polyPatch&,
124  const label patchFacei,
125  const point& faceCentre,
126  TrackingData& td
127  );
128 
129  //- Reverse of leaveDomain
130  template<class TrackingData>
131  inline void enterDomain
132  (
133  const polyMesh&,
134  const polyPatch&,
135  const label patchFacei,
136  const point& faceCentre,
137  TrackingData& td
138  );
139 
140  //- Apply rotation matrix to any coordinates
141  template<class TrackingData>
142  inline void transform
143  (
144  const polyMesh&,
145  const tensor&,
146  TrackingData& td
147  );
148 
149  //- Influence of neighbouring face.
150  template<class TrackingData>
151  inline bool updateCell
152  (
153  const polyMesh&,
154  const label thisCelli,
155  const label neighbourFacei,
156  const wallNormalInfo& neighbourInfo,
157  const scalar tol,
158  TrackingData& td
159  );
160 
161  //- Influence of neighbouring cell.
162  template<class TrackingData>
163  inline bool updateFace
164  (
165  const polyMesh&,
166  const label thisFacei,
167  const label neighbourCelli,
168  const wallNormalInfo& neighbourInfo,
169  const scalar tol,
170  TrackingData& td
171  );
172 
173  //- Influence of different value on same face.
174  template<class TrackingData>
175  inline bool updateFace
176  (
177  const polyMesh&,
178  const label thisFacei,
179  const wallNormalInfo& neighbourInfo,
180  const scalar tol,
181  TrackingData& td
182  );
183 
184  //- Same (like operator==)
185  template<class TrackingData>
186  inline bool equal(const wallNormalInfo&, TrackingData& td) const;
187 
188  // Member Operators
189 
190  // Needed for List IO
191  inline bool operator==(const wallNormalInfo&) const;
192 
193  inline bool operator!=(const wallNormalInfo&) const;
194 
195 
196  // IOstream Operators
197 
198  friend Ostream& operator<<(Ostream&, const wallNormalInfo&);
200 };
201 
202 
203 //- Data associated with wallNormalInfo type are contiguous
204 template<>
205 inline bool contiguous<wallNormalInfo>()
206 {
207  return true;
208 }
209 
210 
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 
213 } // End namespace Foam
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 #include "wallNormalInfoI.H"
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 #endif
222 
223 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
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.
void enterDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Reverse of leaveDomain.
bool contiguous< wallNormalInfo >()
Data associated with wallNormalInfo type are contiguous.
Istream & operator>>(Istream &, directionInfo &)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
bool equal(const wallNormalInfo &, TrackingData &td) const
Same (like operator==)
friend Istream & operator>>(Istream &, wallNormalInfo &)
void leaveDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Convert any absolute coordinates into relative to (patch)face.
wallNormalInfo()
Construct null.
bool operator==(const wallNormalInfo &) const
Ostream & operator<<(Ostream &, const ensightPart &)
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
void transform(const polyMesh &, const tensor &, TrackingData &td)
Apply rotation matrix to any coordinates.
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.