1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 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 \*---------------------------------------------------------------------------*/
27 #include "cellClassification.H"
30 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
32 // Update this with w2 information
33 inline bool Foam::cellInfo::update
36 const label thisFaceI,
37 const label thisCellI,
38 const label neighbourFaceI,
39 const label neighbourCellI
44 (w2.type() == cellClassification::NOTSET)
45 || (w2.type() == cellClassification::CUT)
48 FatalErrorIn("cellInfo::update(const cellInfo&)")
49 << "Problem: trying to propagate NOTSET or CUT type:" << w2.type()
50 << " into cell/face with type:" << type() << endl
51 << "thisFaceI:" << thisFaceI
52 << " thisCellI:" << thisCellI
53 << " neighbourFaceI:" << neighbourFaceI
54 << " neighbourCellI:" << neighbourCellI
59 if (type() == cellClassification::NOTSET)
66 if (type() == cellClassification::CUT)
68 // Reached boundary. Stop.
72 if (type() == w2.type())
74 // Should never happen; already checked in meshWave
78 // Two conflicting types
79 FatalErrorIn("cellInfo::update(const cellInfo&)")
80 << "Problem: trying to propagate conflicting types:" << w2.type()
81 << " into cell/face with type:" << type() << endl
82 << "thisFaceI:" << thisFaceI
83 << " thisCellI:" << thisCellI
84 << " neighbourFaceI:" << neighbourFaceI
85 << " neighbourCellI:" << neighbourCellI
92 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
95 inline Foam::cellInfo::cellInfo()
97 type_(cellClassification::NOTSET)
101 // Construct from components
102 inline Foam::cellInfo::cellInfo(const label type)
109 inline Foam::cellInfo::cellInfo(const cellInfo& w2)
115 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
117 inline bool Foam::cellInfo::valid() const
119 return type_ != cellClassification::NOTSET;
123 // No geometric data so never any problem on cyclics
124 inline bool Foam::cellInfo::sameGeometry
136 // No geometric data.
137 inline void Foam::cellInfo::leaveDomain
140 const polyPatch& patch,
141 const label patchFaceI,
142 const point& faceCentre
147 // No geometric data.
148 inline void Foam::cellInfo::transform
151 const tensor& rotTensor
156 // No geometric data.
157 inline void Foam::cellInfo::enterDomain
160 const polyPatch& patch,
161 const label patchFaceI,
162 const point& faceCentre
167 // Update this with neighbour information
168 inline bool Foam::cellInfo::updateCell
171 const label thisCellI,
172 const label neighbourFaceI,
173 const cellInfo& neighbourInfo,
188 // Update this with neighbour information
189 inline bool Foam::cellInfo::updateFace
192 const label thisFaceI,
193 const label neighbourCellI,
194 const cellInfo& neighbourInfo,
208 // Update this with neighbour information
209 inline bool Foam::cellInfo::updateFace
212 const label thisFaceI,
213 const cellInfo& neighbourInfo,
228 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
230 inline bool Foam::cellInfo::operator==(const Foam::cellInfo& rhs) const
232 return type() == rhs.type();
236 inline bool Foam::cellInfo::operator!=(const Foam::cellInfo& rhs) const
238 return !(*this == rhs);
242 // ************************************************************************* //