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 face edge (from tet decomposition).
30 Face edge is edge between vertex of face and face centre.
34 - index in face (gives the mesh vertex)
39 \*---------------------------------------------------------------------------*/
45 #include "primitiveMesh.H"
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 // Forward declaration of classes
54 /*---------------------------------------------------------------------------*\
55 Class faceEdge Declaration
56 \*---------------------------------------------------------------------------*/
81 //- simple hashing function of labels
82 label operator()(const faceEdge& fe, const label tableSize)
85 // Note: mag since multiply might overflow and produce
91 + (fe.faceLabel() * fe.faceLabel())
93 + (fe.faceIndex() * fe.faceIndex())
109 //- Construct from components
110 inline faceEdge(const label faceLabel, const label faceIndex)
112 faceLabel_(faceLabel),
113 faceIndex_(faceIndex)
118 label faceLabel() const
123 label faceIndex() const
131 const primitiveMesh& mesh,
132 const Field<T>& faceField,
133 const Field<T>& vertField,
137 const face& f = mesh.faces()[faceLabel_];
140 (1-weight)*vertField[f[faceIndex_]]
141 + weight*faceField[faceLabel_];
145 point coord(const primitiveMesh& mesh, const scalar weight) const
147 return interpolate(mesh, mesh.faceCentres(), mesh.points(), weight);
153 bool operator==(const faceEdge& fe) const
156 (faceLabel() == fe.faceLabel())
157 && (faceIndex() == fe.faceIndex());
161 // IOstream Operators
163 inline friend Ostream& operator<<(Ostream& os, const faceEdge& fe)
165 os << token::BEGIN_LIST
166 << fe.faceLabel_ << token::SPACE
170 // Check state of Ostream
171 os.check("Ostream& operator<<(Ostream&, const faceEdge&)");
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 } // End namespace Foam
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 // ************************************************************************* //