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
29 Implicit description of faceCentre to cellCentre edge
30 (from tet decomposition).
34 - whether in owner or neighbour of face
38 \*---------------------------------------------------------------------------*/
44 #include "primitiveMesh.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 // Forward declaration of classes
53 /*---------------------------------------------------------------------------*\
54 Class centreEdge Declaration
55 \*---------------------------------------------------------------------------*/
64 //- is in owner or neighbour of face
80 //- simple hashing function of labels
81 label operator()(const centreEdge& ce, const label tableSize) const
83 return (ce.faceLabel() + ce.inOwner()) % tableSize;
97 //- Construct from components
98 inline centreEdge(const label faceLabel, const bool inOwner)
100 faceLabel_(faceLabel),
106 label faceLabel() const
119 const primitiveMesh& mesh,
120 const Field<T>& cellField,
121 const Field<T>& faceField,
128 cellI = mesh.faceOwner()[faceLabel_];
132 cellI = mesh.faceNeighbour()[faceLabel_];
136 (1-weight)*faceField[faceLabel_]
137 + weight*cellField[cellI];
140 point coord(const primitiveMesh& mesh, const scalar weight) const
154 bool operator==(const centreEdge& ce) const
157 (faceLabel() == ce.faceLabel())
158 && (inOwner() == ce.inOwner());
162 // IOstream Operators
164 inline friend Ostream& operator<<(Ostream& os, const centreEdge& ce)
166 os << token::BEGIN_LIST
167 << ce.faceLabel_ << token::SPACE
171 // Check state of Ostream
172 os.check("Ostream& operator<<(Ostream&, const centreEdge&)");
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 } // End namespace Foam
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 // ************************************************************************* //