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 Maps a geometry to a set of cell primitives, which enables
29 geometric cell data to be calculated without access to the primitive
30 geometric level. This means mapping a 3D geometry to a set of
31 pyramids which are each described by a cell face and the cell centre
37 \*---------------------------------------------------------------------------*/
42 #include "pointField.H"
45 #include "InfoProxy.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 // Forward declaration of friend functions and operators
56 inline bool operator==(const cellModel&, const cellModel&);
57 inline bool operator!=(const cellModel&, const cellModel&);
58 Ostream& operator<<(Ostream&, const cellModel&);
61 /*---------------------------------------------------------------------------*\
62 Class cellModel Declaration
63 \*---------------------------------------------------------------------------*/
72 //- Label in the model list
75 //- Number of points in the model which determines the geometry
78 //- Faces of the model
81 //- Edges of the model
89 //- Construct from Istream
92 //- Return a new cellModel on free-store created from Istream
93 static autoPtr<cellModel> New(Istream& is)
95 return autoPtr<cellModel>(new cellModel(is));
99 autoPtr<cellModel> clone() const
101 return autoPtr<cellModel>(new cellModel(*this));
109 //- Return model name
110 inline const word& name() const;
112 //- Return index of model in the model list
113 inline label index() const;
115 //- Return number of points
116 inline label nPoints() const;
118 //- Return number of edges
119 inline label nEdges() const;
121 //- Return number of faces
122 inline label nFaces() const;
124 //- Return list of edges
125 inline edgeList edges(const labelList& pointLabels) const;
127 //- Return a raw list of model faces
128 inline const faceList& modelFaces() const;
130 //- Return list of faces
131 inline faceList faces(const labelList& pointLabels) const;
137 const labelList& pointLabels,
138 const pointField& points
144 const labelList& pointLabels,
145 const pointField& points
148 //- Return info proxy.
149 // Used to print token information to a stream
150 InfoProxy<cellModel> info() const
155 //- WriteData member function required by regIOobject
156 bool writeData(Ostream& os) const
165 //- Equality operator: true => ptr to models are equal !
166 friend bool operator==(const cellModel&, const cellModel&);
168 //- Inequality operator: true => ptr to models are not equal !
169 friend bool operator!=(const cellModel&, const cellModel&);
174 friend Ostream& operator<<(Ostream&, const cellModel&);
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 } // End namespace Foam
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 #include "cellModelI.H"
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 // ************************************************************************* //