initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / dynamicMesh / meshCut / splitCell / splitCell.H
blob666e9747fad1f4d51731e9146e6e8066a588bc7c
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::splitCell
28 Description
29     Description of cell after splitting. Contains cellLabel and pointers
30     to cells it it split in. See directedRefinement.
32 SourceFiles
33     splitCell.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef splitCell_H
38 #define splitCell_H
40 #include "label.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 // Forward declaration of classes
49 /*---------------------------------------------------------------------------*\
50                            Class splitCell Declaration
51 \*---------------------------------------------------------------------------*/
53 class splitCell
55     // Private data
57         //- Unsplit cell label. Only uptodate if this cell is 'live'
58         //  (i.e. no master or slave)
59         label cellI_;
61         //- Parent splitCell or null
62         splitCell* parent_;
64         //- Cells replacing this or null
65         splitCell* master_;
67         splitCell* slave_;
70     // Private Member Functions
72         //- Disallow default bitwise copy construct
73         splitCell(const splitCell&);
75         //- Disallow default bitwise assignment
76         void operator=(const splitCell&);
79 public:
81     // Constructors
83         //- Construct from cell number and parent
84         splitCell(const label cellI, splitCell* parent);
87     // Destructor
89         ~splitCell();
92     // Member Functions
94         // Access
96             label cellLabel() const
97             {
98                 return cellI_;
99             }
101             label& cellLabel()
102             {
103                 return cellI_;
104             }
106             splitCell* parent() const
107             {
108                 return parent_;
109             }
111             splitCell*& parent()
112             {
113                 return parent_;
114             }
116             splitCell* master() const
117             {
118                 return master_;
119             }
121             splitCell*& master()
122             {
123                 return master_;
124             }
126             splitCell* slave() const
127             {
128                 return slave_;
129             }
131             splitCell*& slave()
132             {
133                 return slave_;
134             }
136             //- Check if this is master cell of split
137             bool isMaster() const;
139             //- Check if this is unrefined (i.e. has no master or slave)
140             bool isUnrefined() const;
142             //- Returns other half of split cell. I.e. slave if this is master.
143             splitCell* getOther() const;
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 } // End namespace Foam
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 #endif
155 // ************************************************************************* //