splitCell.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2023 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 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 public:
70 
71  // Constructors
72 
73  //- Construct from cell number and parent
74  splitCell(const label celli, splitCell* parent);
75 
76  //- Disallow default bitwise copy construction
77  splitCell(const splitCell&) = delete;
78 
79 
80  //- Destructor
81  ~splitCell();
82 
83 
84  // Member Functions
85 
86  // Access
87 
88  label cellLabel() const
89  {
90  return celli_;
91  }
92 
93  label& cellLabel()
94  {
95  return celli_;
96  }
97 
98  splitCell* parent() const
99  {
100  return parent_;
101  }
102 
103  splitCell*& parent()
104  {
105  return parent_;
106  }
107 
108  splitCell* master() const
109  {
110  return master_;
111  }
112 
113  splitCell*& master()
114  {
115  return master_;
116  }
117 
118  splitCell* slave() const
119  {
120  return slave_;
121  }
122 
123  splitCell*& slave()
124  {
125  return slave_;
126  }
127 
128  //- Check if this is master cell of split
129  bool isMaster() const;
130 
131  //- Check if this is unrefined (i.e. has no master or slave)
132  bool isUnrefined() const;
133 
134  //- Returns other half of split cell. I.e. slave if this is master.
135  splitCell* getOther() const;
136 
137 
138  // Member Operators
139 
140  //- Disallow default bitwise assignment
141  void operator=(const splitCell&) = delete;
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
Description of cell after splitting. Contains cellLabel and pointers to cells it split in....
Definition: splitCell.H:52
splitCell * parent() const
Definition: splitCell.H:97
void operator=(const splitCell &)=delete
Disallow default bitwise assignment.
splitCell * slave() const
Definition: splitCell.H:117
bool isMaster() const
Check if this is master cell of split.
Definition: splitCell.C:70
bool isUnrefined() const
Check if this is unrefined (i.e. has no master or slave)
Definition: splitCell.C:100
~splitCell()
Destructor.
Definition: splitCell.C:43
splitCell(const label celli, splitCell *parent)
Construct from cell number and parent.
Definition: splitCell.C:32
splitCell * master() const
Definition: splitCell.H:107
splitCell * getOther() const
Returns other half of split cell. I.e. slave if this is master.
Definition: splitCell.C:106
label cellLabel() const
Definition: splitCell.H:87
Namespace for OpenFOAM.
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