OpenFOAM logo
Open Source CFD Toolkit

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