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::polyModifyCell 00026 00027 Description 00028 Class describing modification of a cell. 00029 00030 \*---------------------------------------------------------------------------*/ 00031 00032 #ifndef polyModifyCell_H 00033 #define polyModifyCell_H 00034 00035 #include <OpenFOAM/label.H> 00036 #include <dynamicMesh/topoAction.H> 00037 00038 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00039 00040 namespace Foam 00041 { 00042 00043 /*---------------------------------------------------------------------------*\ 00044 Class polyModifyCell Declaration 00045 \*---------------------------------------------------------------------------*/ 00046 00047 class polyModifyCell 00048 : 00049 public topoAction 00050 { 00051 // Private data 00052 00053 //- Cell ID 00054 label cellID_; 00055 00056 //- Remove from current zone 00057 bool removeFromZone_; 00058 00059 //- New zone ID 00060 label zoneID_; 00061 00062 00063 public: 00064 00065 // Static data members 00066 00067 //- Runtime type information 00068 TypeName("modifyCell"); 00069 00070 00071 // Constructors 00072 00073 //- Construct null. Used only for list construction 00074 polyModifyCell() 00075 : 00076 cellID_(-1), 00077 removeFromZone_(false), 00078 zoneID_(-1) 00079 {} 00080 00081 //- Construct from components 00082 polyModifyCell 00083 ( 00084 const label cellID, 00085 const bool removeFromZone, 00086 const label newZoneID 00087 ) 00088 : 00089 cellID_(cellID), 00090 removeFromZone_(removeFromZone), 00091 zoneID_(newZoneID) 00092 {} 00093 00094 //- Construct and return a clone 00095 virtual autoPtr<topoAction> clone() const 00096 { 00097 return autoPtr<topoAction>(new polyModifyCell(*this)); 00098 } 00099 00100 00101 // Default Destructor 00102 00103 // Member Functions 00104 00105 //- Cell ID 00106 label cellID() const 00107 { 00108 return cellID_; 00109 } 00110 00111 //- Does the cell belong to a zone? 00112 bool isInZone() const 00113 { 00114 return zoneID_ >= 0; 00115 } 00116 00117 bool removeFromZone() const 00118 { 00119 return removeFromZone_; 00120 } 00121 00122 //- Cell zone ID 00123 label zoneID() const 00124 { 00125 return zoneID_; 00126 } 00127 }; 00128 00129 00130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00131 00132 } // End namespace Foam 00133 00134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00135 00136 #endif 00137 00138 // ************************ vim: set sw=4 sts=4 et: ************************ //