1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
28 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34 inline Foam::sumData::sumData()
42 // Construct from components
43 inline Foam::sumData::sumData
56 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
58 inline bool Foam::sumData::valid() const
60 return oldFace_ != -1;
64 // No geometric data so never any problem on cyclics
65 inline bool Foam::sumData::sameGeometry
77 inline void Foam::sumData::leaveDomain
80 const polyPatch& patch,
81 const label patchFaceI,
82 const point& faceCentre
88 inline void Foam::sumData::transform
91 const tensor& rotTensor
97 inline void Foam::sumData::enterDomain
100 const polyPatch& patch,
101 const label patchFaceI,
102 const point& faceCentre
109 // Update cell with neighbouring face information
110 inline bool Foam::sumData::updateCell
113 const label thisCellI,
114 const label neighbourFaceI,
115 const sumData& neighbourInfo,
121 FatalErrorIn("sumData::updateCell") << "problem"
122 << abort(FatalError);
129 sum_ += neighbourInfo.sum();
130 count_ = neighbourInfo.count() + 1;
131 oldFace_ = neighbourFaceI;
141 // Update face with neighbouring cell information
142 inline bool Foam::sumData::updateFace
144 const polyMesh& mesh,
145 const label thisFaceI,
146 const label neighbourCellI,
147 const sumData& neighbourInfo,
151 // From cell to its faces.
153 // Check that face is opposite the previous one.
154 const cell& cFaces = mesh.cells()[neighbourCellI];
156 label wantedFaceI = cFaces.opposingFaceLabel
158 neighbourInfo.oldFace(),
162 if (thisFaceI == wantedFaceI)
166 FatalErrorIn("sumData::updateFace") << "problem"
167 << abort(FatalError);
171 sum_ += neighbourInfo.sum();
172 count_ = neighbourInfo.count();
173 oldFace_ = thisFaceI;
183 // Update face with coupled face information
184 inline bool Foam::sumData::updateFace
187 const label thisFaceI,
188 const sumData& neighbourInfo,
192 // From face to face (e.g. coupled faces)
195 sum_ += neighbourInfo.sum();
196 count_ = neighbourInfo.count();
197 oldFace_ = thisFaceI;
207 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
209 inline bool Foam::sumData::operator==(const Foam::sumData& rhs)
213 oldFace() == rhs.oldFace()
214 && sum() == rhs.sum()
215 && count() == rhs.count();
219 inline bool Foam::sumData::operator!=(const Foam::sumData& rhs)
222 return !(*this == rhs);
226 // ************************************************************************* //