polyModifyCell.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 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::polyModifyCell
28
29Description
30 Class describing modification of a cell.
31
32\*---------------------------------------------------------------------------*/
33
34#ifndef polyModifyCell_H
35#define polyModifyCell_H
36
37#include "label.H"
38#include "topoAction.H"
39
40// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41
42namespace Foam
43{
44
45/*---------------------------------------------------------------------------*\
46 Class polyModifyCell Declaration
47\*---------------------------------------------------------------------------*/
50:
51 public topoAction
52{
53 // Private data
54
55 //- Cell ID
56 label cellID_;
57
58 //- Remove from current zone
59 bool removeFromZone_;
60
61 //- New zone ID
62 label zoneID_;
63
64
65public:
66
67 // Static data members
68
69 //- Runtime type information
70 TypeName("modifyCell");
71
72
73 // Constructors
74
75 //- Construct null. Used only for list construction
77 :
78 cellID_(-1),
79 removeFromZone_(false),
80 zoneID_(-1)
81 {}
82
83 //- Construct from components
85 (
86 const label cellID,
87 const bool removeFromZone,
88 const label newZoneID
89 )
90 :
91 cellID_(cellID),
92 removeFromZone_(removeFromZone),
93 zoneID_(newZoneID)
94 {}
95
96 //- Construct and return a clone
97 virtual autoPtr<topoAction> clone() const
98 {
99 return autoPtr<topoAction>(new polyModifyCell(*this));
100 }
101
102
103 // Default Destructor
104
105 // Member Functions
106
107 //- Cell ID
108 label cellID() const
109 {
110 return cellID_;
111 }
112
113 //- Does the cell belong to a zone?
114 bool isInZone() const
115 {
116 return zoneID_ >= 0;
117 }
119 bool removeFromZone() const
120 {
121 return removeFromZone_;
122 }
123
124 //- Cell zone ID
125 label zoneID() const
126 {
127 return zoneID_;
128 }
129};
130
131
132// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133
134} // End namespace Foam
135
136// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137
138#endif
139
140// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Class describing modification of a cell.
bool removeFromZone() const
label zoneID() const
Cell zone ID.
label cellID() const
Cell ID.
TypeName("modifyCell")
Runtime type information.
polyModifyCell(const label cellID, const bool removeFromZone, const label newZoneID)
Construct from components.
virtual autoPtr< topoAction > clone() const
Construct and return a clone.
bool isInZone() const
Does the cell belong to a zone?
polyModifyCell()
Construct null. Used only for list construction.
A virtual base class for topological actions.
Definition: topoAction.H:52
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73