1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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 An analytical geometric cellShape.
30 The optional collapse functionality changes the cellModel to the
31 correct type after removing any duplicate points.
39 \*---------------------------------------------------------------------------*/
44 #include "pointField.H"
45 #include "labelList.H"
46 #include "cellModel.H"
48 #include "InfoProxy.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 // Forward declaration of classes
58 // Forward declaration of friend functions and operators
61 bool operator==(const cellShape&, const cellShape&);
62 Istream& operator>>(Istream&, cellShape&);
63 Ostream& operator<<(Ostream&, const cellShape&);
66 /*---------------------------------------------------------------------------*\
67 Class cellShape Declaration
68 \*---------------------------------------------------------------------------*/
76 //- Access to the cellShape's model
87 //- Construct from components
92 const bool doCollapse = false
95 //- Construct from Istream
96 inline cellShape(Istream& is);
99 inline autoPtr<cellShape> clone() const;
104 //- Return the points corresponding to this cellShape
105 inline pointField points(const pointField& meshPoints) const;
108 inline const cellModel& model() const;
110 //- Mesh face labels of this cell (in order of model)
111 inline labelList meshFaces(const faceList& allFaces, const cell&) const;
113 //- Mesh edge labels of this cell (in order of model)
114 inline labelList meshEdges
116 const edgeList& allEdges,
120 //- Faces of this cell
121 inline faceList faces() const;
123 //- Collapsed faces of this cell
124 inline faceList collapsedFaces() const;
127 inline label nFaces() const;
129 //- Edges of this cellShape
130 inline edgeList edges() const;
133 inline label nEdges() const;
136 inline label nPoints() const;
138 //- Centroid of the cell
139 inline point centre(const pointField&) const;
141 //- Return info proxy.
142 // Used to print token information to a stream
143 Foam::InfoProxy<cellShape> info() const
149 inline scalar mag(const pointField&) const;
151 //- Collapse shape to correct one after removing duplicate vertices
157 friend bool operator==(const cellShape&, const cellShape&);
160 // IOstream operators
162 friend Istream& operator>>(Istream&, cellShape&);
163 friend Ostream& operator<<(Ostream&, const cellShape&);
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 } // End namespace Foam
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 #include "cellShapeI.H"
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 // ************************************************************************* //