1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
28 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
30 // Update this with w2 if not yet set.
31 template<class TrackingData>
32 inline bool Foam::wallNormalInfo::update
34 const wallNormalInfo& w2,
42 "wallNormalInfo::update(const wallNormalInfo&)"
43 ) << "Problem: w2 is not valid" << abort(FatalError);
49 // our already set. Stop any transfer
54 normal_ = w2.normal();
61 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
64 inline Foam::wallNormalInfo::wallNormalInfo()
70 // Construct from normal
71 inline Foam::wallNormalInfo::wallNormalInfo(const vector& normal)
78 inline Foam::wallNormalInfo::wallNormalInfo(const wallNormalInfo& wpt)
84 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
86 inline const Foam::vector& Foam::wallNormalInfo::normal() const
92 template<class TrackingData>
93 inline bool Foam::wallNormalInfo::valid(TrackingData& td) const
95 return normal_ != point::max;
99 // No geometric data so never any problem on cyclics
100 template<class TrackingData>
101 inline bool Foam::wallNormalInfo::sameGeometry
104 const wallNormalInfo& w2,
113 // No geometric data.
114 template<class TrackingData>
115 inline void Foam::wallNormalInfo::leaveDomain
118 const polyPatch& patch,
119 const label patchFaceI,
120 const point& faceCentre,
126 // No geometric data.
127 template<class TrackingData>
128 inline void Foam::wallNormalInfo::transform
131 const tensor& rotTensor,
137 // No geometric data.
138 template<class TrackingData>
139 inline void Foam::wallNormalInfo::enterDomain
142 const polyPatch& patch,
143 const label patchFaceI,
144 const point& faceCentre,
150 // Update this with w2 if w2 nearer to pt.
151 template<class TrackingData>
152 inline bool Foam::wallNormalInfo::updateCell
155 const label thisCellI,
156 const label neighbourFaceI,
157 const wallNormalInfo& neighbourWallInfo,
162 return update(neighbourWallInfo, td);
166 // Update this with w2 if w2 nearer to pt.
167 template<class TrackingData>
168 inline bool Foam::wallNormalInfo::updateFace
171 const label thisFaceI,
172 const label neighbourCellI,
173 const wallNormalInfo& neighbourWallInfo,
178 return update(neighbourWallInfo, td);
182 // Update this with w2 if w2 nearer to pt.
183 template<class TrackingData>
184 inline bool Foam::wallNormalInfo::updateFace
187 const label thisFaceI,
188 const wallNormalInfo& neighbourWallInfo,
193 return update(neighbourWallInfo, td);
197 template <class TrackingData>
198 inline bool Foam::wallNormalInfo::equal
200 const wallNormalInfo& rhs,
204 return operator==(rhs);
208 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
210 inline bool Foam::wallNormalInfo::operator==(const Foam::wallNormalInfo& rhs)
213 return normal() == rhs.normal();
217 inline bool Foam::wallNormalInfo::operator!=(const Foam::wallNormalInfo& rhs)
220 return !(*this == rhs);
224 // ************************************************************************* //