1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 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 An analytical geometric cellShape.
31 The optional collapse functionality changes the cellModel to the
32 correct type after removing any duplicate points.
40 \*---------------------------------------------------------------------------*/
45 #include "pointField.H"
46 #include "labelList.H"
47 #include "cellModel.H"
49 #include "InfoProxy.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 // Forward declaration of classes
59 // Forward declaration of friend functions and operators
62 bool operator==(const cellShape&, const cellShape&);
63 Istream& operator>>(Istream&, cellShape&);
64 Ostream& operator<<(Ostream&, const cellShape&);
67 /*---------------------------------------------------------------------------*\
68 Class cellShape Declaration
69 \*---------------------------------------------------------------------------*/
77 //- Access to the cellShape's model
88 //- Construct from components
93 const bool doCollapse = false
96 //- Construct from Istream
97 inline cellShape(Istream& is);
100 inline autoPtr<cellShape> clone() const;
105 //- Return the points corresponding to this cellShape
106 inline pointField points(const pointField& meshPoints) const;
109 inline const cellModel& model() const;
111 //- Mesh face labels of this cell (in order of model)
112 inline labelList meshFaces(const faceList& allFaces, const cell&) const;
114 //- Mesh edge labels of this cell (in order of model)
115 inline labelList meshEdges
117 const edgeList& allEdges,
121 //- Faces of this cell
122 inline faceList faces() const;
124 //- Collapsed faces of this cell
125 inline faceList collapsedFaces() const;
128 inline label nFaces() const;
130 //- Edges of this cellShape
131 inline edgeList edges() const;
134 inline label nEdges() const;
137 inline label nPoints() const;
139 //- Centroid of the cell
140 inline point centre(const pointField&) const;
142 //- Return info proxy.
143 // Used to print token information to a stream
144 Foam::InfoProxy<cellShape> info() const
150 inline scalar mag(const pointField&) const;
152 //- Collapse shape to correct one after removing duplicate vertices
158 friend bool operator==(const cellShape&, const cellShape&);
161 // IOstream operators
163 friend Istream& operator>>(Istream&, cellShape&);
164 friend Ostream& operator<<(Ostream&, const cellShape&);
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 } // End namespace Foam
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 #include "cellShapeI.H"
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 // ************************************************************************* //