FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::polyAddCell
00026 
00027 Description
00028     Class containing data for cell addition.
00029 
00030 \*---------------------------------------------------------------------------*/
00031 
00032 #ifndef polyAddCell_H
00033 #define polyAddCell_H
00034 
00035 #include <OpenFOAM/label.H>
00036 #include <dynamicMesh/topoAction.H>
00037 
00038 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00039 
00040 namespace Foam
00041 {
00042 
00043 /*---------------------------------------------------------------------------*\
00044                            Class polyAddCell Declaration
00045 \*---------------------------------------------------------------------------*/
00046 
00047 class polyAddCell
00048 :
00049     public topoAction
00050 {
00051     // Private data
00052 
00053         //- Master point ID for cells blown up from points
00054         label masterPointID_;
00055 
00056         //- Master edge ID for cells blown up from edges
00057         label masterEdgeID_;
00058 
00059         //- Master face ID for cells blown up from faces
00060         label masterFaceID_;
00061 
00062         //- Master cell ID for cells blown up from cells
00063         label masterCellID_;
00064 
00065         //- Cell zone ID
00066         label zoneID_;
00067 
00068 
00069 public:
00070 
00071     // Static data members
00072 
00073         //- Runtime type information
00074         TypeName("addCell");
00075 
00076 
00077     // Constructors
00078 
00079         //- Construct null.  Used for constructing lists
00080         polyAddCell()
00081         :
00082             masterPointID_(-1),
00083             masterEdgeID_(-1),
00084             masterFaceID_(-1),
00085             masterCellID_(-1),
00086             zoneID_(-1)
00087         {}
00088 
00089         //- Construct from components
00090         polyAddCell
00091         (
00092             const label masterPointID,
00093             const label masterEdgeID,
00094             const label masterFaceID,
00095             const label masterCellID,
00096             const label zoneID
00097         )
00098         :
00099             masterPointID_(masterPointID),
00100             masterEdgeID_(masterEdgeID),
00101             masterFaceID_(masterFaceID),
00102             masterCellID_(masterCellID),
00103             zoneID_(zoneID)
00104         {}
00105 
00106         //- Construct and return a clone
00107         virtual autoPtr<topoAction> clone() const
00108         {
00109             return autoPtr<topoAction>(new polyAddCell(*this));
00110         }
00111 
00112 
00113     // Default Destructor
00114 
00115 
00116     // Member Functions
00117 
00118         //- Is the cell mastered by a point
00119         bool isPointMaster() const
00120         {
00121             return masterPointID_ >= 0;
00122         }
00123 
00124         //- Is the cell mastered by an edge
00125         bool isEdgeMaster() const
00126         {
00127             return masterEdgeID_ >= 0;
00128         }
00129 
00130         //- Is the cell mastered by another face
00131         bool isFaceMaster() const
00132         {
00133             return masterFaceID_ >= 0;
00134         }
00135 
00136         //- Is the cell mastered by another cell
00137         bool isCellMaster() const
00138         {
00139             return masterCellID_ >= 0;
00140         }
00141 
00142         //- Is the cell appended with no master
00143         bool appended() const
00144         {
00145             return
00146                 !isPointMaster() && !isEdgeMaster()
00147              && !isFaceMaster() && !isCellMaster();
00148         }
00149 
00150         //- Return master point ID
00151         label masterPointID() const
00152         {
00153             return masterPointID_;
00154         }
00155 
00156         //- Return master edge ID
00157         label masterEdgeID() const
00158         {
00159             return masterEdgeID_;
00160         }
00161 
00162         //- Return master face ID
00163         label masterFaceID() const
00164         {
00165             return masterFaceID_;
00166         }
00167 
00168         //- Return master cell ID
00169         label masterCellID() const
00170         {
00171             return masterCellID_;
00172         }
00173 
00174         //- Does the cell belong to a zone?
00175         bool isInZone() const
00176         {
00177             return zoneID_ >= 0;
00178         }
00179 
00180         //- Cell zone ID
00181         label zoneID() const
00182         {
00183             return zoneID_;
00184         }
00185 
00186 };
00187 
00188 
00189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00190 
00191 } // End namespace Foam
00192 
00193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00194 
00195 #endif
00196 
00197 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines