zonalThermoZones.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) 2026 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::zonalThermoZones
26 
27 Description
28  Mesh object to store cell-zone correspondence for zonal thermo.
29 
30 SourceFiles
31  zonalThermoZones.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef zonalThermoZones_H
36 #define zonalThermoZones_H
37 
38 #include "DemandDrivenMeshObject.H"
39 #include "fvMesh.H"
40 #include "hashedWordList.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class zonalThermoZones Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class zonalThermoZones
52 :
54  <
55  fvMesh,
56  TopoChangeableMeshObject,
57  zonalThermoZones
58  >
59 {
60  // Private Data
61 
62  //- The names of the zones
63  const hashedWordList& zones_;
64 
65  //- For each cell, the (local) index of the zone
66  labelList cellZones_;
67 
68 
69  // Private Member Functions
70 
71  //- Update the cell-zones map
72  void update();
73 
74 
75 protected:
76 
77  friend class DemandDrivenMeshObject
78  <
79  fvMesh,
82  >;
83 
84 
85  // Protected Constructors
86 
87  //- Construct from a name, a mesh and a list of zones
88  explicit zonalThermoZones
89  (
90  const word& name,
91  const fvMesh& mesh,
92  const hashedWordList& zones
93  );
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("zonalThermoZones");
100 
101 
102  // Constructors
103 
104  //- Disallow default bitwise copy construction
105  zonalThermoZones(const zonalThermoZones&) = delete;
106 
107  //- Inherit the base New method
109  <
110  fvMesh,
113  >::New;
114 
115 
116  //- Destructor
117  virtual ~zonalThermoZones();
118 
119 
120  // Member Functions
121 
122  //- Access the cell zone indices
123  inline const labelList& cellZones() const
124  {
125  return cellZones_;
126  }
127 
128  //- Update for mesh motion
129  virtual bool movePoints();
130 
131  //- Update topology using the given map
132  virtual void topoChange(const polyTopoChangeMap&);
133 
134  //- Update from another mesh using the given map
135  virtual void mapMesh(const polyMeshMap&);
136 
137  //- Redistribute or update using the given distribution map
138  virtual void distribute(const polyDistributionMap&);
139 };
140 
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 } // End namespace Foam
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #endif
149 
150 // ************************************************************************* //
Templated abstract base-class for demand-driven mesh objects used to automate their allocation to the...
static zonalThermoZones & New(const word &name, const fvMesh &mesh)
Construct and return the named DemandDrivenMeshObject.
const word & name() const
Return name.
Definition: IOobject.H:307
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
A wordList with hashed indices for faster lookup by name.
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
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for handling words, derived from string.
Definition: word.H:63
Mesh object to store cell-zone correspondence for zonal thermo.
virtual bool movePoints()
Update for mesh motion.
zonalThermoZones(const word &name, const fvMesh &mesh, const hashedWordList &zones)
Construct from a name, a mesh and a list of zones.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
TypeName("zonalThermoZones")
Runtime type information.
const labelList & cellZones() const
Access the cell zone indices.
virtual ~zonalThermoZones()
Destructor.
Namespace for OpenFOAM.