wallNormalInfoI.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) 2020 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
27\*---------------------------------------------------------------------------*/
28
29#include "polyMesh.H"
30
31// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
32
33// Update this with w2 if not yet set.
34template<class TrackingData>
36(
37 const wallNormalInfo& w2,
38 TrackingData& td
39)
40{
41 if (!w2.valid(td))
42 {
44 << "Problem: w2 is not valid" << abort(FatalError);
45
46 return false;
47 }
48 else if (valid(td))
49 {
50 // our already set. Stop any transfer
51 return false;
52 }
53 else
54 {
55 normal_ = w2.normal();
56
57 return true;
58 }
59}
60
61
62// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
63
65:
66 normal_(point::max)
67{}
68
69
71:
72 normal_(normal)
73{}
74
75
76// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
77
78template<class TrackingData>
79inline bool Foam::wallNormalInfo::valid(TrackingData& td) const
80{
81 return normal_ != point::max;
82}
83
84
85// No geometric data so never any problem on cyclics
86template<class TrackingData>
88(
89 const polyMesh&,
90 const wallNormalInfo& w2,
91 const scalar tol,
92 TrackingData& td
93) const
94{
95 return true;
96}
97
98
99// No geometric data.
100template<class TrackingData>
102(
103 const polyMesh&,
104 const polyPatch& patch,
105 const label patchFacei,
106 const point& faceCentre,
107 TrackingData& td
108)
109{}
110
111
112// No geometric data.
113template<class TrackingData>
115(
116 const polyMesh&,
117 const tensor& rotTensor,
118 TrackingData& td
119)
120{}
121
122
123// No geometric data.
124template<class TrackingData>
126(
127 const polyMesh&,
128 const polyPatch& patch,
129 const label patchFacei,
130 const point& faceCentre,
131 TrackingData& td
132)
133{}
134
135
136// Update this with w2 if w2 nearer to pt.
137template<class TrackingData>
139(
140 const polyMesh&,
141 const label thisCelli,
142 const label neighbourFacei,
143 const wallNormalInfo& neighbourWallInfo,
144 const scalar tol,
145 TrackingData& td
146)
147{
148 return update(neighbourWallInfo, td);
149}
150
151
152// Update this with w2 if w2 nearer to pt.
153template<class TrackingData>
155(
156 const polyMesh&,
157 const label thisFacei,
158 const label neighbourCelli,
159 const wallNormalInfo& neighbourWallInfo,
160 const scalar tol,
161 TrackingData& td
162)
163{
164 return update(neighbourWallInfo, td);
165}
166
167
168// Update this with w2 if w2 nearer to pt.
169template<class TrackingData>
171(
172 const polyMesh&,
173 const label thisFacei,
174 const wallNormalInfo& neighbourWallInfo,
175 const scalar tol,
176 TrackingData& td
177)
178{
179 return update(neighbourWallInfo, td);
180}
181
182
183template<class TrackingData>
185(
186 const wallNormalInfo& rhs,
187 TrackingData& td
188) const
189{
190 return operator==(rhs);
191}
192
193
194// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
195
197(
198 const wallNormalInfo& rhs
199) const
200{
201 return normal_ == rhs.normal_;
202}
203
204
206(
207 const wallNormalInfo& rhs
208) const
209{
210 return !(*this == rhs);
211}
212
213
214// ************************************************************************* //
#define w2
Definition: blockCreate.C:35
bool valid() const
True if all internal ids are non-negative.
friend Ostream & operator(Ostream &, const faMatrix< Type > &)
virtual bool update()
Update the mesh for both mesh motion and topology change.
Default transformation behaviour.
static const complex max
complex (VGREAT,VGREAT)
Definition: complex.H:293
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
Holds information regarding nearest wall point. Used in wall refinement.
wallNormalInfo()
Default construct.
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)
bool valid(TrackingData &td) const
Changed or contains original (invalid) value.
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()
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
errorManip< error > abort(error &err)
Definition: errorManip.H:144
error FatalError