generatedCellZone.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) 2022-2025 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::generatedCellZone
26 
27 Description
28  cellZone selection or generation class
29 
30  The cellZone is either looked-up from the mesh or generated by a
31  zoneGenerator and stored locally.
32 
33 Usage
34  Examples:
35  \verbatim
36  // Select all the cells
37  cellZone all;
38 
39  // Select the cells within the cellZone rotor
40  cellZone rotor;
41 
42  // Select the cells within the given box
43  cellZone
44  {
45  type box;
46  box (3.48 -0.1 -0.1) (3.5 0.1 0.1);
47  }
48 
49  // Select the cell containing the given point
50  cellZone
51  {
52  type containsPoints;
53  points ((0.075 0.2 0.05));
54  }
55  \endverbatim
56 
57 See also
58  Foam::generatedZoneSet
59  Foam::zoneGenerator
60 
61 SourceFiles
62  generatedCellZone.C
63  generatedCellZoneI.H
64 
65 \*---------------------------------------------------------------------------*/
66 
67 #ifndef generatedCellZone_H
68 #define generatedCellZone_H
69 
70 #include "generatedZoneSet.H"
71 
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 
74 namespace Foam
75 {
76 
77 class polyMesh;
78 class polyMeshMap;
79 class polyDistributionMap;
80 
81 /*---------------------------------------------------------------------------*\
82  Class generatedCellZone Declaration
83 \*---------------------------------------------------------------------------*/
84 
86 {
87  // Private data
88 
89  //- Reference to the mesh
90  const polyMesh& mesh_;
91 
92  //- Switch for all cells
93  bool all_;
94 
95  generatedZoneSet cellZone_;
96 
97 
98 public:
99 
100  // Constructors
101 
102  //- Construct from mesh selecting all cells
104 
105  //- Construct from mesh and dictionary
107 
108  //- Disallow default bitwise copy construction
109  generatedCellZone(const generatedCellZone&) = delete;
110 
111 
112  //- Destructor
114 
115 
116  // Member Functions
117 
118  // Access
119 
120  //- Return true if the set comprises all the cells
121  inline bool all() const;
122 
123  //- Return const access to the name of cellZone
124  inline const word& name() const;
125 
126  //- Return const access to the cell set
127  inline const cellZone& zone() const;
128 
129  //- Return the number of cells in the set
130  inline label nCells() const;
131 
132  //- Return the cell index corresponding to the cell set index
133  inline label celli(const label i) const;
134 
135 
136  // Mesh changes
137 
138  //- Update for mesh motion
139  void movePoints();
140 
141  //- Update topology using the given map
142  void topoChange(const polyTopoChangeMap&);
143 
144  //- Update from another mesh using the given map
145  void mapMesh(const polyMeshMap&);
146 
147  //- Redistribute or update using the given distribution map
148  void distribute(const polyDistributionMap&);
149 
150 
151  // IO
152 
153  //- Read coefficients dictionary
154  bool read(const dictionary& dict);
155 
156 
157  // Member Operators
158 
159  //- Disallow default bitwise assignment
160  void operator=(const generatedCellZone&) = delete;
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #include "generatedCellZoneI.H"
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #endif
175 
176 // ************************************************************************* //
Named list of cell indices representing a sub-set of the mesh.
Definition: cellZone.H:61
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
cellZone selection or generation class
const cellZone & zone() const
Return const access to the cell set.
label celli(const label i) const
Return the cell index corresponding to the cell set index.
void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
void movePoints()
Update for mesh motion.
bool read(const dictionary &dict)
Read coefficients dictionary.
bool all() const
Return true if the set comprises all the cells.
void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
void operator=(const generatedCellZone &)=delete
Disallow default bitwise assignment.
label nCells() const
Return the number of cells in the set.
generatedCellZone(const polyMesh &mesh)
Construct from mesh selecting all cells.
const word & name() const
Return const access to the name of cellZone.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for handling words, derived from string.
Definition: word.H:62
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
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
dictionary dict