1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 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
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/>.
28 A cell is defined as a list of faces with extra functionality
33 \*---------------------------------------------------------------------------*/
39 #include "oppositeFace.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 // Forward declaration of friend functions and operators
49 bool operator==(const cell&, const cell&);
50 inline bool operator!=(const cell&, const cell&);
53 /*---------------------------------------------------------------------------*\
54 Class cell Declaration
55 \*---------------------------------------------------------------------------*/
64 // Static data members
66 static const char* const typeName;
74 //- Construct given size
75 explicit inline cell(label);
77 //- Construct from list of labels
78 explicit inline cell(const labelUList&);
80 //- Construct by transferring the parameter contents
81 explicit inline cell(const Xfer<labelList>&);
83 //- Construct from Istream
84 inline cell(Istream&);
89 //- Return number of faces
90 inline label nFaces() const;
92 //- Return labels of cell vertices
93 labelList labels(const faceUList&) const;
95 //- Return the cell vertices
96 pointField points(const faceUList&, const pointField&) const;
99 edgeList edges(const faceUList&) const;
101 //- Return index of opposite face
102 label opposingFaceLabel
104 const label masterFaceLabel,
105 const faceUList& meshFaces
108 //- Return opposite face oriented the same way as the master face
109 oppositeFace opposingFace
111 const label masterFaceLabel,
112 const faceUList& meshFaces
116 // Instructions for centre and mag:
117 // When one wants to access the cell centre and magnitude, the
118 // functionality on the mesh level should be used in preference to the
119 // functions provided here. They do not rely to the functionality
120 // implemented here, provide additional checking and are more efficient.
121 // The cell::centre and cell::mag functions may be removed in the
124 //- Returns cell centre
125 point centre(const pointField&, const faceUList&) const;
127 //- Returns cell volume
128 scalar mag(const pointField&, const faceUList&) const;
133 friend bool operator==(const cell&, const cell&);
134 friend bool operator!=(const cell&, const cell&);
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 } // End namespace Foam
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 // ************************************************************************* //