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-2019 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 polyMesh&,
104  const polyPatch& patch,
105  const label patchFacei,
106  const point& faceCentre,
107  TrackingData& td
108 )
109 {}
110 
111 
112 template<class TrackingData>
114 (
115  const polyMesh&,
116  const tensor& rotTensor,
117  TrackingData& td
118 )
119 {}
120 
121 
122 template<class TrackingData>
124 (
125  const polyMesh&,
126  const polyPatch& patch,
127  const label patchFacei,
128  const point& faceCentre,
129  TrackingData& td
130 )
131 {}
132 
133 
134 template<class TrackingData>
136 (
137  const polyMesh&,
138  const label thisCelli,
139  const label neighbourFacei,
140  const wallNormalInfo& neighbourWallInfo,
141  const scalar tol,
142  TrackingData& td
143 )
144 {
145  return update(neighbourWallInfo, td);
146 }
147 
148 
149 template<class TrackingData>
151 (
152  const polyMesh&,
153  const label thisFacei,
154  const label neighbourCelli,
155  const wallNormalInfo& neighbourWallInfo,
156  const scalar tol,
157  TrackingData& td
158 )
159 {
160  return update(neighbourWallInfo, td);
161 }
162 
163 
164 template<class TrackingData>
166 (
167  const polyMesh&,
168  const label thisFacei,
169  const wallNormalInfo& neighbourWallInfo,
170  const scalar tol,
171  TrackingData& td
172 )
173 {
174  return update(neighbourWallInfo, td);
175 }
176 
177 
178 template<class TrackingData>
179 inline bool Foam::wallNormalInfo::equal
180 (
181  const wallNormalInfo& rhs,
182  TrackingData& td
183 ) const
184 {
185  return operator==(rhs);
186 }
187 
188 
189 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
190 
191 inline bool Foam::wallNormalInfo::operator==
192 (
193  const Foam::wallNormalInfo& rhs
194 ) const
195 {
196  return normal() == rhs.normal();
197 }
198 
199 
200 inline bool Foam::wallNormalInfo::operator!=
201 (
202  const Foam::wallNormalInfo& rhs
203 ) const
204 {
205  return !(*this == rhs);
206 }
207 
208 
209 // ************************************************************************* //
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
Holds information regarding nearest wall point. Used in wall refinement.
error FatalError
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
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 enterDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Reverse of leaveDomain.
errorManip< error > abort(error &err)
Definition: errorManip.H:131
bool equal(const wallNormalInfo &, TrackingData &td) const
Same (like operator==)
void leaveDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Convert any absolute coordinates into relative to (patch)face.
wallNormalInfo()
Construct null.
bool operator==(const wallNormalInfo &) const
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
void transform(const polyMesh &, const tensor &, TrackingData &td)
Apply rotation matrix to any coordinates.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
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.