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/>.
26 \*---------------------------------------------------------------------------*/
29 #include "cellModel.H"
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
38 inline const word& cellModel::name() const
44 inline label cellModel::index() const
50 inline label cellModel::nPoints() const
56 inline label cellModel::nEdges() const
62 inline label cellModel::nFaces() const
68 // Return the faces of a cellModel by untangling the geometry
69 // supplied in terms of the face labels
70 inline edgeList cellModel::edges(const labelList& pointLabels) const
72 edgeList e(edges_.size());
74 // Translate model lebels into global labels
80 pointLabels[edges_[edgeI].start()],
81 pointLabels[edges_[edgeI].end()]
89 // Return a raw list of model faces
90 inline const faceList& cellModel::modelFaces() const
95 // Return the faces of a cellModel by untangling the geometry
96 // supplied in terms of the face labels
97 inline faceList cellModel::faces(const labelList& pointLabels) const
99 faceList f(faces_.size());
101 // Translate model lebels into global labels
102 forAll(faces_, faceI)
104 const labelList& curModelLabels = faces_[faceI];
106 face& curFace = f[faceI];
108 curFace.setSize(curModelLabels.size());
110 forAll(curModelLabels, labelI)
112 curFace[labelI] = pointLabels[curModelLabels[labelI]];
120 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
122 // Equality operator: true => ptr to models are equal !
123 inline bool operator==(const cellModel& m1, const cellModel& m2)
128 // Inequality operator: true => ptr to models are not equal !
129 inline bool operator!=(const cellModel& m1, const cellModel& m2)
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 } // End namespace Foam
139 // ************************************************************************* //