zonesGenerator.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) 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::zonesGenerator
26 
27 Description
28  MeshObject zoneGeneratorList instantiated by polyMesh
29 
30  to provide optional dynamic zones which may be updated following mesh motion
31  and/or topology change.
32 
33 See also
34  Foam::zoneGeneratorList
35  Foam::zoneGenerator
36  Foam::zoneSet
37 
38 SourceFiles
39  zonesGenerator.C
40 
41 \*---------------------------------------------------------------------------*/
42 #ifndef zonesGenerator_H
43 #define zonesGenerator_H
44 
45 #include "zoneGeneratorList.H"
46 #include "DemandDrivenMeshObject.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class zonesGenerator Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class zonesGenerator
58 :
60  <
61  polyMesh,
62  TopoChangeableMeshObject,
63  zonesGenerator
64  >,
65  public dictionary,
66  public zoneGeneratorList
67 {
68  // Private Member Functions
69 
70  //- Create IO object for an optional zonesGenerator
71  IOobject io(const polyMesh& mesh) const;
72 
73  void generate();
74 
75 
76 protected:
77 
78  // Protected Constructors
79 
80  friend class DemandDrivenMeshObject;
81 
82  //- Read construct from polyMesh
83  explicit zonesGenerator(const polyMesh& mesh);
84 
85 
86 public:
87 
88  //- Runtime type information
89  TypeName("zonesGenerator");
90 
91 
92  // Constructors
93 
94  //- Disallow default bitwise copy construction
95  zonesGenerator(const zonesGenerator&) = delete;
96 
98  <
99  polyMesh,
102  >::New;
103 
104 
105  //- Destructor
106  virtual ~zonesGenerator()
107  {}
108 
109 
110  // Member Functions
111 
112  //- Declare zonesGenerator to be a global dictionary
113  virtual bool global() const
114  {
115  return true;
116  }
117 
118  //- ReadData function required for regIOobject read operation
119  virtual bool readData(Istream&);
120 
121  //- WriteData function required for regIOobject write operation
122  virtual bool writeData(Ostream&) const;
123 
124  //- Read the zonesGenerator dictionary if it has changed
125  // and regenerate
126  virtual bool read();
127 
128  //- Update for mesh motion
129  virtual bool movePoints();
130 
131  //- Redistribute or update using the given distribution map
132  virtual void distribute(const polyDistributionMap& map);
133 
134  //- Update topology using the given map
135  virtual void topoChange(const polyTopoChangeMap& map);
136 
137  //- Update from another mesh using the given map
138  virtual void mapMesh(const polyMeshMap& map);
139 
140 
141  // Member Operators
142 
143  //- Disallow default bitwise assignment
144  void operator=(const zonesGenerator&) = delete;
145 };
146 
147 
148 //- Trait for obtaining global status
149 template<>
151 {
152  static const bool global = true;
153 };
154 
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #endif
163 
164 // ************************************************************************* //
Templated abstract base-class for demand-driven mesh objects used to automate their allocation to the...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
static autoPtr< dictionary > New(Istream &)
Construct top-level dictionary on freestore from Istream.
Definition: dictionaryIO.C:103
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.
List of zoneGenerators.
MeshObject zoneGeneratorList instantiated by polyMesh.
virtual bool movePoints()
Update for mesh motion.
void operator=(const zonesGenerator &)=delete
Disallow default bitwise assignment.
virtual bool writeData(Ostream &) const
WriteData function required for regIOobject write operation.
TypeName("zonesGenerator")
Runtime type information.
zonesGenerator(const polyMesh &mesh)
Read construct from polyMesh.
virtual bool global() const
Declare zonesGenerator to be a global dictionary.
virtual void mapMesh(const polyMeshMap &map)
Update from another mesh using the given map.
virtual ~zonesGenerator()
Destructor.
virtual void distribute(const polyDistributionMap &map)
Redistribute or update using the given distribution map.
virtual bool readData(Istream &)
ReadData function required for regIOobject read operation.
virtual void topoChange(const polyTopoChangeMap &map)
Update topology using the given map.
virtual bool read()
Read the zonesGenerator dictionary if it has changed.
Namespace for OpenFOAM.
Trait for obtaining global status.
Definition: IOobject.H:503
static const bool global
Definition: IOobject.H:504