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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::wallNormalInfo
29
30Description
31 Holds information regarding nearest wall point.
32 Used in wall refinement.
33
34SourceFiles
35 wallNormalInfoI.H
36 wallNormalInfo.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef wallNormalInfo_H
41#define wallNormalInfo_H
42
43#include "point.H"
44#include "label.H"
45#include "scalar.H"
46#include "tensor.H"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
52
53// Forward Declarations
54class polyPatch;
55class polyMesh;
56class wallNormalInfo;
57
58Istream& operator>>(Istream&, wallNormalInfo&);
59Ostream& operator<<(Ostream&, const wallNormalInfo&);
60
61/*---------------------------------------------------------------------------*\
62 Class wallNormalInfo Declaration
63\*---------------------------------------------------------------------------*/
66{
67 // Private Data
68
69 //- Normal at nearest wall point
70 vector normal_;
71
72
73 // Private Member Functions
74
75 //- Evaluate distance to point and update normal_
76 template<class TrackingData>
77 inline bool update(const wallNormalInfo& w2, TrackingData& td);
78
79
80public:
81
82 // Constructors
83
84 //- Default construct
85 inline wallNormalInfo();
86
87 //- Construct from normal
88 inline wallNormalInfo(const vector& normal);
89
90
91
92 // Member Functions
93
94 // Access
96 const vector& normal() const
97 {
98 return normal_;
99 }
100 vector& normal()
101 {
102 return normal_;
103 }
104
105
106 // Needed by FaceCellWave
107
108 //- Changed or contains original (invalid) value
109 template<class TrackingData>
110 inline bool valid(TrackingData& td) const;
111
112 //- Check for identical geometrical data (eg, cyclics checking)
113 template<class TrackingData>
114 inline bool sameGeometry
115 (
116 const polyMesh&,
117 const wallNormalInfo&,
118 const scalar,
119 TrackingData& td
120 ) const;
121
122 //- Convert any absolute coordinates into relative to (patch)face
123 // centre
124 template<class TrackingData>
125 inline void leaveDomain
126 (
127 const polyMesh&,
128 const polyPatch&,
129 const label patchFacei,
130 const point& faceCentre,
131 TrackingData& td
132 );
133
134 //- Reverse of leaveDomain
135 template<class TrackingData>
136 inline void enterDomain
137 (
138 const polyMesh&,
139 const polyPatch&,
140 const label patchFacei,
141 const point& faceCentre,
142 TrackingData& td
143 );
144
145 //- Apply rotation matrix to any coordinates
146 template<class TrackingData>
147 inline void transform
148 (
149 const polyMesh&,
150 const tensor&,
151 TrackingData& td
152 );
153
154 //- Influence of neighbouring face.
155 template<class TrackingData>
156 inline bool updateCell
157 (
158 const polyMesh&,
159 const label thisCelli,
160 const label neighbourFacei,
161 const wallNormalInfo& neighbourInfo,
162 const scalar tol,
163 TrackingData& td
164 );
165
166 //- Influence of neighbouring cell.
167 template<class TrackingData>
168 inline bool updateFace
169 (
170 const polyMesh&,
171 const label thisFacei,
172 const label neighbourCelli,
173 const wallNormalInfo& neighbourInfo,
174 const scalar tol,
175 TrackingData& td
176 );
177
178 //- Influence of different value on same face.
179 template<class TrackingData>
180 inline bool updateFace
181 (
182 const polyMesh&,
183 const label thisFacei,
184 const wallNormalInfo& neighbourInfo,
185 const scalar tol,
186 TrackingData& td
187 );
188
189 //- Test for equality, with TrackingData
190 template<class TrackingData>
191 inline bool equal(const wallNormalInfo&, TrackingData& td) const;
192
193
194 // Member Operators
195
196 //- Test for equality
197 inline bool operator==(const wallNormalInfo&) const;
198
199 //- Test for inequality
200 inline bool operator!=(const wallNormalInfo&) const;
201
202
203 // IOstream Operators
207};
208
209
210// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
211
212//- Contiguous data for wallNormalInfo
213template<> struct is_contiguous<wallNormalInfo> : std::true_type {};
214
215
216// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217
218} // End namespace Foam
219
220// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221
222#include "wallNormalInfoI.H"
223
224// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225
226#endif
227
228// ************************************************************************* //
#define w2
Definition: blockCreate.C:35
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
Tensor of scalars, i.e. Tensor<scalar>.
Holds information regarding nearest wall point. Used in wall refinement.
friend Ostream & operator<<(Ostream &, const wallNormalInfo &)
wallNormalInfo()
Default construct.
void transform(const polyMesh &, const tensor &, TrackingData &td)
Apply rotation matrix to any coordinates.
bool operator==(const wallNormalInfo &) const
Test for equality.
void enterDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Reverse of leaveDomain.
bool updateCell(const polyMesh &, const label thisCelli, const label neighbourFacei, const wallNormalInfo &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
bool sameGeometry(const polyMesh &, const wallNormalInfo &, const scalar, TrackingData &td) const
Check for identical geometrical data (eg, cyclics checking)
friend Istream & operator>>(Istream &, wallNormalInfo &)
bool operator!=(const wallNormalInfo &) const
Test for inequality.
bool valid(TrackingData &td) const
Changed or contains original (invalid) value.
const vector & normal() const
bool updateFace(const polyMesh &, const label thisFacei, const label neighbourCelli, const wallNormalInfo &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
void leaveDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Convert any absolute coordinates into relative to (patch)face.
bool equal(const wallNormalInfo &, TrackingData &td) const
Test for equality, with TrackingData.
mesh update()
Namespace for OpenFOAM.
vector point
Point is a vector.
Definition: point.H:43
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Istream & operator>>(Istream &, directionInfo &)
A template class to specify that a data type can be considered as being contiguous in memory.
Definition: contiguous.H:78