OpenFOAM logo
Open Source CFD Toolkit

polyAddCell.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2005 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     polyAddCell
00027 
00028 Description
00029     Class containing data for cell addition.
00030 
00031 \*---------------------------------------------------------------------------*/
00032 
00033 #ifndef polyAddCell_H
00034 #define polyAddCell_H
00035 
00036 #include "label.H"
00037 #include "topoAction.H"
00038 
00039 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00040 
00041 namespace Foam
00042 {
00043 
00044 /*---------------------------------------------------------------------------*\
00045                            Class polyAddCell Declaration
00046 \*---------------------------------------------------------------------------*/
00047 
00048 class polyAddCell
00049 :
00050     public topoAction
00051 {
00052     // Private data
00053 
00054         //- Master point ID for cells blown up from points
00055         label masterPointID_;
00056 
00057         //- Master edge ID for cells blown up from edges
00058         label masterEdgeID_;
00059 
00060         //- Master face ID for cells blown up from faces
00061         label masterFaceID_;
00062 
00063         //- Master cell ID for cells blown up from cells
00064         label masterCellID_;
00065 
00066         //- Cell zone ID
00067         label zoneID_;
00068 
00069 
00070 public:
00071 
00072     // Static data members
00073 
00074         //- Runtime type information
00075         TypeName("addCell");
00076 
00077 
00078     // Constructors
00079 
00080         //- Construct null.  Used for constructing lists
00081         polyAddCell()
00082         :
00083             masterPointID_(-1),
00084             masterEdgeID_(-1),
00085             masterFaceID_(-1),
00086             masterCellID_(-1),
00087             zoneID_(-1)
00088         {}
00089 
00090         //- Construct from components
00091         polyAddCell
00092         (
00093             const label masterPointID,
00094             const label masterEdgeID,
00095             const label masterFaceID,
00096             const label masterCellID,
00097             const label zoneID
00098         )
00099         :
00100             masterPointID_(masterPointID),
00101             masterEdgeID_(masterEdgeID),
00102             masterFaceID_(masterFaceID),
00103             masterCellID_(masterCellID),
00104             zoneID_(zoneID)
00105         {}
00106 
00107         //- Construct and return a clone
00108         virtual autoPtr<topoAction> clone() const
00109         {
00110             return autoPtr<topoAction>(new polyAddCell(*this));
00111         }
00112 
00113 
00114     // Default Destructor
00115 
00116 
00117     // Member Functions
00118 
00119         //- Is the cell mastered by a point
00120         bool isPointMaster() const
00121         {
00122             return masterPointID_ >= 0;
00123         }
00124 
00125         //- Is the cell mastered by an edge
00126         bool isEdgeMaster() const
00127         {
00128             return masterEdgeID_ >= 0;
00129         }
00130 
00131         //- Is the cell mastered by another face
00132         bool isFaceMaster() const
00133         {
00134             return masterFaceID_ >= 0;
00135         }
00136 
00137         //- Is the cell mastered by another cell
00138         bool isCellMaster() const
00139         {
00140             return masterCellID_ >= 0;
00141         }
00142 
00143         //- Is the cell appended with no master
00144         bool appended() const
00145         {
00146             return
00147                 !isPointMaster() && !isEdgeMaster()
00148              && !isFaceMaster() && !isCellMaster();
00149         }
00150 
00151         //- Return master point ID
00152         label masterPointID() const
00153         {
00154             return masterPointID_;
00155         }
00156 
00157         //- Return master edge ID
00158         label masterEdgeID() const
00159         {
00160             return masterEdgeID_;
00161         }
00162 
00163         //- Return master face ID
00164         label masterFaceID() const
00165         {
00166             return masterFaceID_;
00167         }
00168 
00169         //- Return master cell ID
00170         label masterCellID() const
00171         {
00172             return masterCellID_;
00173         }
00174 
00175         //- Does the cell belong to a zone?
00176         bool isInZone() const
00177         {
00178             return zoneID_ >= 0;
00179         }
00180 
00181         //- Cell zone ID
00182         label zoneID() const
00183         {
00184             return zoneID_;
00185         }
00186 
00187 };
00188 
00189 
00190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00191 
00192 } // End namespace Foam
00193 
00194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00195 
00196 #endif
00197 
00198 // ************************************************************************* //
For further information go to www.openfoam.org