1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
29 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
31 // Update this with w2 if not yet set.
32 inline bool Foam::wallNormalInfo::update(const wallNormalInfo& w2)
38 "wallNormalInfo::update(const wallNormalInfo&)"
39 ) << "Problem: w2 is not valid" << abort(FatalError);
45 // our already set. Stop any transfer
50 normal_ = w2.normal();
57 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
60 inline Foam::wallNormalInfo::wallNormalInfo()
66 // Construct from normal
67 inline Foam::wallNormalInfo::wallNormalInfo(const vector& normal)
74 inline Foam::wallNormalInfo::wallNormalInfo(const wallNormalInfo& wpt)
80 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
82 inline const Foam::vector& Foam::wallNormalInfo::normal() const
88 inline bool Foam::wallNormalInfo::valid() const
90 return normal_ != greatVector;
94 // No geometric data so never any problem on cyclics
95 inline bool Foam::wallNormalInfo::sameGeometry
98 const wallNormalInfo& w2,
106 // No geometric data.
107 inline void Foam::wallNormalInfo::leaveDomain
110 const polyPatch& patch,
111 const label patchFaceI,
112 const point& faceCentre
117 // No geometric data.
118 inline void Foam::wallNormalInfo::transform
121 const tensor& rotTensor
126 // No geometric data.
127 inline void Foam::wallNormalInfo::enterDomain
130 const polyPatch& patch,
131 const label patchFaceI,
132 const point& faceCentre
137 // Update this with w2 if w2 nearer to pt.
138 inline bool Foam::wallNormalInfo::updateCell
141 const label thisCellI,
142 const label neighbourFaceI,
143 const wallNormalInfo& neighbourWallInfo,
147 return update(neighbourWallInfo);
151 // Update this with w2 if w2 nearer to pt.
152 inline bool Foam::wallNormalInfo::updateFace
155 const label thisFaceI,
156 const label neighbourCellI,
157 const wallNormalInfo& neighbourWallInfo,
161 return update(neighbourWallInfo);
165 // Update this with w2 if w2 nearer to pt.
166 inline bool Foam::wallNormalInfo::updateFace
169 const label thisFaceI,
170 const wallNormalInfo& neighbourWallInfo,
174 return update(neighbourWallInfo);
178 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
180 inline bool Foam::wallNormalInfo::operator==(const Foam::wallNormalInfo& rhs)
183 return normal() == rhs.normal();
187 inline bool Foam::wallNormalInfo::operator!=(const Foam::wallNormalInfo& rhs)
190 return !(*this == rhs);
194 // ************************************************************************* //