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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::splitCell
28 
29 Description
30  Description of cell after splitting. Contains cellLabel and pointers
31  to cells it it split in. See directedRefinement.
32 
33 SourceFiles
34  splitCell.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef splitCell_H
39 #define splitCell_H
40 
41 #include "label.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class splitCell Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class splitCell
53 {
54  // Private Data
55 
56  //- Unsplit cell label.
57  // Only uptodate if this cell is 'live' (i.e. no master or slave)
58  label celli_;
59 
60  //- Parent splitCell or nullptr
61  splitCell* parent_;
62 
63  //- Cells replacing this or nullptr
64  splitCell* master_;
65 
66  splitCell* slave_;
67 
68 
69  // Private Member Functions
70 
71  //- No copy construct
72  splitCell(const splitCell&) = delete;
73 
74  //- No copy assignment
75  void operator=(const splitCell&) = delete;
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  }
103 
104  splitCell* parent() const
105  {
106  return parent_;
107  }
108 
109  splitCell*& parent()
110  {
111  return parent_;
112  }
113 
114  splitCell* master() const
115  {
116  return master_;
117  }
118 
119  splitCell*& master()
120  {
121  return master_;
122  }
123 
124  splitCell* slave() const
125  {
126  return slave_;
127  }
128 
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 // ************************************************************************* //
Foam::splitCell::slave
splitCell * slave() const
Definition: splitCell.H:123
Foam::splitCell::cellLabel
label & cellLabel()
Definition: splitCell.H:98
Foam::splitCell::isUnrefined
bool isUnrefined() const
Check if this is unrefined (i.e. has no master or slave)
Definition: splitCell.C:101
Foam::splitCell::parent
splitCell * parent() const
Definition: splitCell.H:103
Foam::splitCell::getOther
splitCell * getOther() const
Returns other half of split cell. I.e. slave if this is master.
Definition: splitCell.C:107
Foam::splitCell::cellLabel
label cellLabel() const
Definition: splitCell.H:93
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::splitCell
Description of cell after splitting. Contains cellLabel and pointers to cells it it split in....
Definition: splitCell.H:51
Foam::splitCell::master
splitCell *& master()
Definition: splitCell.H:118
label.H
Foam::splitCell::parent
splitCell *& parent()
Definition: splitCell.H:108
Foam::splitCell::master
splitCell * master() const
Definition: splitCell.H:113
Foam::splitCell::slave
splitCell *& slave()
Definition: splitCell.H:128
Foam::splitCell::isMaster
bool isMaster() const
Check if this is master cell of split.
Definition: splitCell.C:71
Foam::splitCell::~splitCell
~splitCell()
Destructor.
Definition: splitCell.C:44