1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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 \*---------------------------------------------------------------------------*/
26 #include "cellClassification.H"
29 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
31 // Update this with w2 information
32 template<class TrackingData>
33 inline bool Foam::cellInfo::update
36 const label thisFaceI,
37 const label thisCellI,
38 const label neighbourFaceI,
39 const label neighbourCellI,
45 (w2.type() == cellClassification::NOTSET)
46 || (w2.type() == cellClassification::CUT)
49 FatalErrorIn("cellInfo::update(const cellInfo&)")
50 << "Problem: trying to propagate NOTSET or CUT type:" << w2.type()
51 << " into cell/face with type:" << type() << endl
52 << "thisFaceI:" << thisFaceI
53 << " thisCellI:" << thisCellI
54 << " neighbourFaceI:" << neighbourFaceI
55 << " neighbourCellI:" << neighbourCellI
60 if (type() == cellClassification::NOTSET)
67 if (type() == cellClassification::CUT)
69 // Reached boundary. Stop.
73 if (type() == w2.type())
75 // Should never happen; already checked in meshWave
79 // Two conflicting types
80 FatalErrorIn("cellInfo::update(const cellInfo&)")
81 << "Problem: trying to propagate conflicting types:" << w2.type()
82 << " into cell/face with type:" << type() << endl
83 << "thisFaceI:" << thisFaceI
84 << " thisCellI:" << thisCellI
85 << " neighbourFaceI:" << neighbourFaceI
86 << " neighbourCellI:" << neighbourCellI
93 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
96 inline Foam::cellInfo::cellInfo()
98 type_(cellClassification::NOTSET)
102 // Construct from components
103 inline Foam::cellInfo::cellInfo(const label type)
110 inline Foam::cellInfo::cellInfo(const cellInfo& w2)
116 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
118 template<class TrackingData>
119 inline bool Foam::cellInfo::valid(TrackingData& td) const
121 return type_ != cellClassification::NOTSET;
125 // No geometric data so never any problem on cyclics
126 template<class TrackingData>
127 inline bool Foam::cellInfo::sameGeometry
140 // No geometric data.
141 template<class TrackingData>
142 inline void Foam::cellInfo::leaveDomain
145 const polyPatch& patch,
146 const label patchFaceI,
147 const point& faceCentre,
153 // No geometric data.
154 template<class TrackingData>
155 inline void Foam::cellInfo::transform
158 const tensor& rotTensor,
164 // No geometric data.
165 template<class TrackingData>
166 inline void Foam::cellInfo::enterDomain
169 const polyPatch& patch,
170 const label patchFaceI,
171 const point& faceCentre,
177 // Update this with neighbour information
178 template<class TrackingData>
179 inline bool Foam::cellInfo::updateCell
182 const label thisCellI,
183 const label neighbourFaceI,
184 const cellInfo& neighbourInfo,
201 // Update this with neighbour information
202 template<class TrackingData>
203 inline bool Foam::cellInfo::updateFace
206 const label thisFaceI,
207 const label neighbourCellI,
208 const cellInfo& neighbourInfo,
224 // Update this with neighbour information
225 template<class TrackingData>
226 inline bool Foam::cellInfo::updateFace
229 const label thisFaceI,
230 const cellInfo& neighbourInfo,
247 template <class TrackingData>
248 inline bool Foam::cellInfo::equal
254 return operator==(rhs);
258 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
260 inline bool Foam::cellInfo::operator==(const Foam::cellInfo& rhs) const
262 return type() == rhs.type();
266 inline bool Foam::cellInfo::operator!=(const Foam::cellInfo& rhs) const
268 return !(*this == rhs);
272 // ************************************************************************* //