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