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::splitCell 00026 00027 Description 00028 Description of cell after splitting. Contains cellLabel and pointers 00029 to cells it it split in. See directedRefinement. 00030 00031 SourceFiles 00032 splitCell.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef splitCell_H 00037 #define splitCell_H 00038 00039 #include <OpenFOAM/label.H> 00040 00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00042 00043 namespace Foam 00044 { 00045 00046 // Forward declaration of classes 00047 00048 /*---------------------------------------------------------------------------*\ 00049 Class splitCell Declaration 00050 \*---------------------------------------------------------------------------*/ 00051 00052 class splitCell 00053 { 00054 // Private data 00055 00056 //- Unsplit cell label. Only uptodate if this cell is 'live' 00057 // (i.e. no master or slave) 00058 label cellI_; 00059 00060 //- Parent splitCell or null 00061 splitCell* parent_; 00062 00063 //- Cells replacing this or null 00064 splitCell* master_; 00065 00066 splitCell* slave_; 00067 00068 00069 // Private Member Functions 00070 00071 //- Disallow default bitwise copy construct 00072 splitCell(const splitCell&); 00073 00074 //- Disallow default bitwise assignment 00075 void operator=(const splitCell&); 00076 00077 00078 public: 00079 00080 // Constructors 00081 00082 //- Construct from cell number and parent 00083 splitCell(const label cellI, splitCell* parent); 00084 00085 00086 // Destructor 00087 00088 ~splitCell(); 00089 00090 00091 // Member Functions 00092 00093 // Access 00094 00095 label cellLabel() const 00096 { 00097 return cellI_; 00098 } 00099 00100 label& cellLabel() 00101 { 00102 return cellI_; 00103 } 00104 00105 splitCell* parent() const 00106 { 00107 return parent_; 00108 } 00109 00110 splitCell*& parent() 00111 { 00112 return parent_; 00113 } 00114 00115 splitCell* master() const 00116 { 00117 return master_; 00118 } 00119 00120 splitCell*& master() 00121 { 00122 return master_; 00123 } 00124 00125 splitCell* slave() const 00126 { 00127 return slave_; 00128 } 00129 00130 splitCell*& slave() 00131 { 00132 return slave_; 00133 } 00134 00135 //- Check if this is master cell of split 00136 bool isMaster() const; 00137 00138 //- Check if this is unrefined (i.e. has no master or slave) 00139 bool isUnrefined() const; 00140 00141 //- Returns other half of split cell. I.e. slave if this is master. 00142 splitCell* getOther() const; 00143 }; 00144 00145 00146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00147 00148 } // End namespace Foam 00149 00150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00151 00152 #endif 00153 00154 // ************************ vim: set sw=4 sts=4 et: ************************ //