wallNormalInfoI.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-2022 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 \*---------------------------------------------------------------------------*/
25 
26 #include "polyMesh.H"
27 
28 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
29 
30 template<class TrackingData>
31 inline bool Foam::wallNormalInfo::update
32 (
33  const wallNormalInfo& w2,
34  TrackingData& td
35 )
36 {
37  if (!w2.valid(td))
38  {
40  << "Problem: w2 is not valid" << abort(FatalError);
41 
42  return false;
43  }
44  else if (valid(td))
45  {
46  // our already set. Stop any transfer
47  return false;
48  }
49  else
50  {
51  normal_ = w2.normal();
52 
53  return true;
54  }
55 }
56 
57 
58 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
59 
61 :
62  normal_(point::max)
63 {}
64 
65 
67 :
68  normal_(normal)
69 {}
70 
71 
72 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
73 
75 {
76  return normal_;
77 }
78 
79 
80 template<class TrackingData>
81 inline bool Foam::wallNormalInfo::valid(TrackingData& td) const
82 {
83  return normal_ != point::max;
84 }
85 
86 
87 template<class TrackingData>
89 (
90  const polyMesh&,
91  const wallNormalInfo& w2,
92  const scalar tol,
93  TrackingData& td
94 ) const
95 {
96  return true;
97 }
98 
99 
100 template<class TrackingData>
102 (
103  const polyPatch& patch,
104  const label patchFacei,
105  const transformer& transform,
106  TrackingData& td
107 )
108 {}
109 
110 
111 template<class TrackingData>
113 (
114  const polyMesh&,
115  const label thisCelli,
116  const label neighbourFacei,
117  const wallNormalInfo& neighbourWallInfo,
118  const scalar tol,
119  TrackingData& td
120 )
121 {
122  return update(neighbourWallInfo, td);
123 }
124 
125 
126 template<class TrackingData>
128 (
129  const polyMesh&,
130  const label thisFacei,
131  const label neighbourCelli,
132  const wallNormalInfo& neighbourWallInfo,
133  const scalar tol,
134  TrackingData& td
135 )
136 {
137  return update(neighbourWallInfo, td);
138 }
139 
140 
141 template<class TrackingData>
143 (
144  const polyMesh&,
145  const label thisFacei,
146  const wallNormalInfo& neighbourWallInfo,
147  const scalar tol,
148  TrackingData& td
149 )
150 {
151  return update(neighbourWallInfo, td);
152 }
153 
154 
155 template<class TrackingData>
157 (
158  const wallNormalInfo& rhs,
159  TrackingData& td
160 ) const
161 {
162  return operator==(rhs);
163 }
164 
165 
166 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
167 
168 inline bool Foam::wallNormalInfo::operator==
169 (
170  const Foam::wallNormalInfo& rhs
171 ) const
172 {
173  return normal() == rhs.normal();
174 }
175 
176 
177 inline bool Foam::wallNormalInfo::operator!=
178 (
179  const Foam::wallNormalInfo& rhs
180 ) const
181 {
182  return !(*this == rhs);
183 }
184 
185 
186 // ************************************************************************* //
#define w2
Definition: blockCreate.C:32
static const Form max
Definition: VectorSpace.H:115
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:70
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space.
Definition: transformer.H:84
Holds information regarding nearest wall point. Used in wall refinement.
wallNormalInfo()
Construct null.
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. Used for cyclics checking.
const vector & normal() const
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 transform(const polyPatch &patch, const label patchFacei, const transformer &transform, TrackingData &td)
Transform across an interface.
bool equal(const wallNormalInfo &, TrackingData &td) const
Same (like operator==)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:306
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
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
errorManip< error > abort(error &err)
Definition: errorManip.H:131
dimensionSet transform(const dimensionSet &)
Definition: dimensionSet.C:483
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
error FatalError