1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 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 Class containing data for cell addition.
31 \*---------------------------------------------------------------------------*/
37 #include "topoAction.H"
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 /*---------------------------------------------------------------------------*\
45 Class polyAddCell Declaration
46 \*---------------------------------------------------------------------------*/
54 //- Master point ID for cells blown up from points
57 //- Master edge ID for cells blown up from edges
60 //- Master face ID for cells blown up from faces
63 //- Master cell ID for cells blown up from cells
72 // Static data members
74 //- Runtime type information
80 //- Construct null. Used for constructing lists
90 //- Construct from components
93 const label masterPointID,
94 const label masterEdgeID,
95 const label masterFaceID,
96 const label masterCellID,
100 masterPointID_(masterPointID),
101 masterEdgeID_(masterEdgeID),
102 masterFaceID_(masterFaceID),
103 masterCellID_(masterCellID),
107 //- Construct and return a clone
108 virtual autoPtr<topoAction> clone() const
110 return autoPtr<topoAction>(new polyAddCell(*this));
114 // Default Destructor
119 //- Is the cell mastered by a point
120 bool isPointMaster() const
122 return masterPointID_ >= 0;
125 //- Is the cell mastered by an edge
126 bool isEdgeMaster() const
128 return masterEdgeID_ >= 0;
131 //- Is the cell mastered by another face
132 bool isFaceMaster() const
134 return masterFaceID_ >= 0;
137 //- Is the cell mastered by another cell
138 bool isCellMaster() const
140 return masterCellID_ >= 0;
143 //- Is the cell appended with no master
144 bool appended() const
147 !isPointMaster() && !isEdgeMaster()
148 && !isFaceMaster() && !isCellMaster();
151 //- Return master point ID
152 label masterPointID() const
154 return masterPointID_;
157 //- Return master edge ID
158 label masterEdgeID() const
160 return masterEdgeID_;
163 //- Return master face ID
164 label masterFaceID() const
166 return masterFaceID_;
169 //- Return master cell ID
170 label masterCellID() const
172 return masterCellID_;
175 //- Does the cell belong to a zone?
176 bool isInZone() const
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 } // End namespace Foam
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 // ************************************************************************* //