FreeFOAM The Cross-Platform CFD Toolkit
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 | Copyright (C) 1991-2010 OpenCFD Ltd.
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 <OpenFOAM/polyMesh.H>
27 
28 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
29 
30 // Update this with w2 if not yet set.
31 inline bool Foam::wallNormalInfo::update(const wallNormalInfo& w2)
32 {
33  if (!w2.valid())
34  {
36  (
37  "wallNormalInfo::update(const wallNormalInfo&)"
38  ) << "Problem: w2 is not valid" << abort(FatalError);
39 
40  return false;
41  }
42  else if (valid())
43  {
44  // our already set. Stop any transfer
45  return false;
46  }
47  else
48  {
49  normal_ = w2.normal();
50 
51  return true;
52  }
53 }
54 
55 
56 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
57 
58 // Null constructor
60 :
61  normal_(greatVector)
62 {}
63 
64 
65 // Construct from normal
67 :
68  normal_(normal)
69 {}
70 
71 
72 // Construct as copy
74 :
75  normal_(wpt.normal())
76 {}
77 
78 
79 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
80 
82 {
83  return normal_;
84 }
85 
86 
87 inline bool Foam::wallNormalInfo::valid() const
88 {
89  return normal_ != greatVector;
90 }
91 
92 
93 // No geometric data so never any problem on cyclics
95 (
96  const polyMesh&,
97  const wallNormalInfo& w2,
98  const scalar tol
99 ) const
100 {
101  return true;
102 }
103 
104 
105 // No geometric data.
107 (
108  const polyMesh&,
109  const polyPatch& patch,
110  const label patchFaceI,
111  const point& faceCentre
112 )
113 {}
114 
115 
116 // No geometric data.
118 (
119  const polyMesh&,
120  const tensor& rotTensor
121 )
122 {}
123 
124 
125 // No geometric data.
127 (
128  const polyMesh&,
129  const polyPatch& patch,
130  const label patchFaceI,
131  const point& faceCentre
132 )
133 {}
134 
135 
136 // Update this with w2 if w2 nearer to pt.
138 (
139  const polyMesh&,
140  const label thisCellI,
141  const label neighbourFaceI,
142  const wallNormalInfo& neighbourWallInfo,
143  const scalar tol
144 )
145 {
146  return update(neighbourWallInfo);
147 }
148 
149 
150 // Update this with w2 if w2 nearer to pt.
152 (
153  const polyMesh&,
154  const label thisFaceI,
155  const label neighbourCellI,
156  const wallNormalInfo& neighbourWallInfo,
157  const scalar tol
158 )
159 {
160  return update(neighbourWallInfo);
161 }
162 
163 
164 // Update this with w2 if w2 nearer to pt.
166 (
167  const polyMesh&,
168  const label thisFaceI,
169  const wallNormalInfo& neighbourWallInfo,
170  const scalar tol
171 )
172 {
173  return update(neighbourWallInfo);
174 }
175 
176 
177 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
178 
180  const
181 {
182  return normal() == rhs.normal();
183 }
184 
185 
187  const
188 {
189  return !(*this == rhs);
190 }
191 
192 
193 // ************************ vim: set sw=4 sts=4 et: ************************ //