splitCell.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::splitCell
26 
27 Description
28  Description of cell after splitting. Contains cellLabel and pointers
29  to cells it it split in. See directedRefinement.
30 
31 SourceFiles
32  splitCell.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef splitCell_H
37 #define splitCell_H
38 
39 #include "label.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of classes
47 
48 /*---------------------------------------------------------------------------*\
49  Class splitCell Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class splitCell
53 {
54  // Private data
55 
56  //- Unsplit cell label. Only uptodate if this cell is 'live'
57  // (i.e. no master or slave)
58  label celli_;
59 
60  //- Parent splitCell or null
61  splitCell* parent_;
62 
63  //- Cells replacing this or null
64  splitCell* master_;
65 
66  splitCell* slave_;
67 
68 
69  // Private Member Functions
70 
71  //- Disallow default bitwise copy construct
72  splitCell(const splitCell&);
73 
74  //- Disallow default bitwise assignment
75  void operator=(const splitCell&);
76 
77 
78 public:
79 
80  // Constructors
81 
82  //- Construct from cell number and parent
83  splitCell(const label celli, splitCell* parent);
84 
85 
86  //- Destructor
87  ~splitCell();
88 
89 
90  // Member Functions
91 
92  // Access
93 
94  label cellLabel() const
95  {
96  return celli_;
97  }
98 
99  label& cellLabel()
100  {
101  return celli_;
102  }
104  splitCell* parent() const
105  {
106  return parent_;
107  }
109  splitCell*& parent()
110  {
111  return parent_;
112  }
114  splitCell* master() const
115  {
116  return master_;
117  }
119  splitCell*& master()
120  {
121  return master_;
122  }
124  splitCell* slave() const
125  {
126  return slave_;
127  }
129  splitCell*& slave()
130  {
131  return slave_;
132  }
133 
134  //- Check if this is master cell of split
135  bool isMaster() const;
136 
137  //- Check if this is unrefined (i.e. has no master or slave)
138  bool isUnrefined() const;
139 
140  //- Returns other half of split cell. I.e. slave if this is master.
141  splitCell* getOther() const;
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
splitCell * parent() const
Definition: splitCell.H:103
splitCell * master() const
Definition: splitCell.H:113
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
bool isMaster() const
Check if this is master cell of split.
Definition: splitCell.C:70
label cellLabel() const
Definition: splitCell.H:93
splitCell * getOther() const
Returns other half of split cell. I.e. slave if this is master.
Definition: splitCell.C:106
bool isUnrefined() const
Check if this is unrefined (i.e. has no master or slave)
Definition: splitCell.C:100
Description of cell after splitting. Contains cellLabel and pointers to cells it it split in...
Definition: splitCell.H:51
splitCell * slave() const
Definition: splitCell.H:123
~splitCell()
Destructor.
Definition: splitCell.C:43
Namespace for OpenFOAM.