generatedZoneSet.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-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::generatedZoneSet
26 
27 Description
28 
29 
30 See also
31  Foam::zoneSet
32  Foam::zoneGenerator
33 
34 SourceFiles
35  generatedZoneSet.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef generatedZoneSet_H
40 #define generatedZoneSet_H
41 
42 #include "zoneGenerator.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class generatedZoneSet Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class generatedZoneSet
54 :
55  public zoneSet
56 {
57  // Private Data
58 
59  autoPtr<zoneGenerator> zoneGenerator_;
60 
61  //- Optional switch to regenerate the zones
62  // when the regenerate function is called.
63  // Useful if the zones are not purely geometric, e.g. field dependent
64  bool regenerate_;
65 
66 
67 public:
68 
69  // Constructors
70 
71  //- Construct null
73  :
74  regenerate_(false)
75  {}
76 
77  //- Construct from name, mesh and dictionary
79  (
80  const word& name,
81  const polyMesh& mesh,
82  const dictionary& dict
83  );
84 
85  //- Construct from name, zoneType, mesh and dictionary
87  (
88  const word& name,
89  const zoneTypes& zoneType,
90  const polyMesh& mesh,
91  const dictionary& dict
92  );
93 
94  //- Disallow default bitwise copy construction
95  generatedZoneSet(const generatedZoneSet&) = delete;
96 
97 
98  // Member Functions
99 
100  //- Read from dictionary
101  void read
102  (
103  const word& name,
104  const polyMesh& mesh,
105  const dictionary& dict,
106  const bool onDemand = false
107  );
108 
109  //- Read from dictionary
110  void read
111  (
112  const word& name,
113  const zoneTypes& zoneType,
114  const polyMesh& mesh,
115  const dictionary& dict,
116  const bool onDemand = false
117  );
118 
119  //- Set the zoneGenerator and generate the zoneSet
120  void set(const autoPtr<zoneGenerator>& zg);
121 
122  //- Generate the zones and assign to the zoneSet
123  void generate();
124 
125  //- Regenerate the zones if the regenerate switch is set true
126  // and return true if regenerated
127  // Useful if the zones are not purely geometric, e.g. field dependent
128  bool regenerate();
129 
130  //- Update for mesh motion
131  bool movePoints();
132 
133  //- Redistribute or update using the given distribution map
134  void distribute(const polyDistributionMap& map);
135 
136  //- Update topology using the given map
137  void topoChange(const polyTopoChangeMap& map);
138 
139  //- Update from another mesh using the given map
140  void mapMesh(const polyMeshMap& map);
141 
142 
143  // Member Operators
144 
145  //- Disallow default bitwise assignment
146  void operator=(const generatedZoneSet&) = delete;
147 };
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace Foam
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #endif
157 
158 // ************************************************************************* //
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
bool movePoints()
Update for mesh motion.
generatedZoneSet()
Construct null.
void read(const word &name, const polyMesh &mesh, const dictionary &dict, const bool onDemand=false)
Read from dictionary.
void generate()
Generate the zones and assign to the zoneSet.
void operator=(const generatedZoneSet &)=delete
Disallow default bitwise assignment.
void set(const autoPtr< zoneGenerator > &zg)
Set the zoneGenerator and generate the zoneSet.
void mapMesh(const polyMeshMap &map)
Update from another mesh using the given map.
void distribute(const polyDistributionMap &map)
Redistribute or update using the given distribution map.
void topoChange(const polyTopoChangeMap &map)
Update topology using the given map.
bool regenerate()
Regenerate the zones if the regenerate switch is set true.
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:78
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
Zone container returned by zoneGenerator::generate.
Definition: zoneSet.H:94
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
Namespace for OpenFOAM.
zoneTypes zoneType()
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
zoneTypes
Enumeration defining the zone types.
Definition: zoneSet.H:66
dictionary dict