1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2010-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 * * * * * * * * * * * //
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34 inline Foam::topoDistanceData::topoDistanceData()
41 // Construct from components
42 inline Foam::topoDistanceData::topoDistanceData
53 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
55 template <class TrackingData>
56 inline bool Foam::topoDistanceData::valid(TrackingData& td) const
58 return distance_ != -1;
62 // No geometric data so never any problem on cyclics
63 template <class TrackingData>
64 inline bool Foam::topoDistanceData::sameGeometry
67 const topoDistanceData&,
77 template <class TrackingData>
78 inline void Foam::topoDistanceData::leaveDomain
81 const polyPatch& patch,
82 const label patchFaceI,
83 const point& faceCentre,
90 template <class TrackingData>
91 inline void Foam::topoDistanceData::transform
94 const tensor& rotTensor,
100 // No geometric data.
101 template <class TrackingData>
102 inline void Foam::topoDistanceData::enterDomain
105 const polyPatch& patch,
106 const label patchFaceI,
107 const point& faceCentre,
113 // Update cell with neighbouring face information
114 template <class TrackingData>
115 inline bool Foam::topoDistanceData::updateCell
118 const label thisCellI,
119 const label neighbourFaceI,
120 const topoDistanceData& neighbourInfo,
127 data_ = neighbourInfo.data_;
128 distance_ = neighbourInfo.distance_ + 1;
138 // Update face with neighbouring cell information
139 template <class TrackingData>
140 inline bool Foam::topoDistanceData::updateFace
142 const polyMesh& mesh,
143 const label thisFaceI,
144 const label neighbourCellI,
145 const topoDistanceData& neighbourInfo,
150 // From cell to its faces.
154 operator=(neighbourInfo);
164 // Update face with coupled face information
165 template <class TrackingData>
166 inline bool Foam::topoDistanceData::updateFace
169 const label thisFaceI,
170 const topoDistanceData& neighbourInfo,
175 // From face to face (e.g. coupled faces)
178 operator=(neighbourInfo);
188 template <class TrackingData>
189 inline bool Foam::topoDistanceData::equal
191 const topoDistanceData& rhs,
195 return operator==(rhs);
199 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
201 inline bool Foam::topoDistanceData::operator==
203 const Foam::topoDistanceData& rhs
206 return data() == rhs.data() && distance() == rhs.distance();
210 inline bool Foam::topoDistanceData::operator!=
212 const Foam::topoDistanceData& rhs
215 return !(*this == rhs);
219 // ************************************************************************* //