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