FreeFOAM The Cross-Platform CFD Toolkit
wallNormalInfo.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 | Copyright (C) 1991-2010 OpenCFD Ltd.
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 <OpenFOAM/point.H>
41 #include <OpenFOAM/label.H>
42 #include <OpenFOAM/scalar.H>
43 #include <OpenFOAM/tensor.H>
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 // Forward declaration of classes
51 class polyPatch;
52 class polyMesh;
53 
54 /*---------------------------------------------------------------------------*\
55  Class wallNormalInfo Declaration
56 \*---------------------------------------------------------------------------*/
57 
59 {
60  // Private data
61 
62  //- Normal at nearest wall point
63  vector normal_;
64 
65  // Private Member Functions
66 
67  //- Evaluate distance to point. Update normal_
68  inline bool update(const wallNormalInfo& w2);
69 
70 public:
71 
72  // Static data members
73 
74  //- initial point far away.
76 
77  // Constructors
78 
79  //- Construct null
80  inline wallNormalInfo();
81 
82  //- Construct from normal
83  inline wallNormalInfo(const vector& normal);
84 
85  //- Construct as copy
86  inline wallNormalInfo(const wallNormalInfo&);
87 
88  // Member Functions
89 
90  // Access
91 
92  inline const vector& normal() const;
93 
94 
95  // Needed by FaceCellWave
96 
97  //- Check whether origin has been changed at all or
98  // still contains original (invalid) value.
99  inline bool valid() const;
100 
101  //- Check for identical geometrical data. Used for cyclics checking.
102  inline bool sameGeometry
103  (
104  const polyMesh&,
105  const wallNormalInfo&,
106  const scalar
107  ) const;
108 
109  //- Convert any absolute coordinates into relative to (patch)face
110  // centre
111  inline void leaveDomain
112  (
113  const polyMesh&,
114  const polyPatch&,
115  const label patchFaceI,
116  const point& faceCentre
117  );
118 
119  //- Reverse of leaveDomain
120  inline void enterDomain
121  (
122  const polyMesh&,
123  const polyPatch&,
124  const label patchFaceI,
125  const point& faceCentre
126  );
127 
128  //- Apply rotation matrix to any coordinates
129  inline void transform
130  (
131  const polyMesh&,
132  const tensor&
133  );
134 
135  //- Influence of neighbouring face.
136  inline bool updateCell
137  (
138  const polyMesh&,
139  const label thisCellI,
140  const label neighbourFaceI,
141  const wallNormalInfo& neighbourInfo,
142  const scalar tol
143  );
144 
145  //- Influence of neighbouring cell.
146  inline bool updateFace
147  (
148  const polyMesh&,
149  const label thisFaceI,
150  const label neighbourCellI,
151  const wallNormalInfo& neighbourInfo,
152  const scalar tol
153  );
154 
155  //- Influence of different value on same face.
156  inline bool updateFace
157  (
158  const polyMesh&,
159  const label thisFaceI,
160  const wallNormalInfo& neighbourInfo,
161  const scalar tol
162  );
163 
164  // Member Operators
165 
166  // Needed for List IO
167  inline bool operator==(const wallNormalInfo&) const;
168 
169  inline bool operator!=(const wallNormalInfo&) const;
170 
171 
172  // IOstream Operators
173 
174  friend Ostream& operator<<(Ostream&, const wallNormalInfo&);
176 };
177 
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 } // End namespace Foam
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #endif
190 
191 // ************************ vim: set sw=4 sts=4 et: ************************ //