set.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::zoneGenerators::set
26 
27 Description
28  A zoneGenerator which converts a set into the corresponding zone
29 
30  The faceZone generated from a face set is unoriented because face sets do
31  not provide the orientation flipMap.
32 
33 Usage
34  \table
35  Property | Description | Required | Default value
36  type | Type: set | yes |
37  name | Name of the zone | no | zoneGenerator name
38  setName | Name of the set | no | zone name
39  zoneType | Type of set/zone | yes |
40  \endtable
41 
42  Create a cellZone named \c setCells containing the cells in the set:
43  \verbatim
44  setCells
45  {
46  type set;
47  zoneType cell;
48  setName boxCells;
49  }
50  \endverbatim
51  of if the zoneGenerator, cellZone and set all have the name \c boxCells
52  this simpler specification can be used:
53  \verbatim
54  boxCells
55  {
56  type set;
57  zoneType cell;
58  }
59  \endverbatim
60 
61 SourceFiles
62  set.C
63 
64 \*---------------------------------------------------------------------------*/
65 
66 #ifndef set_zoneGenerator_H
67 #define set_zoneGenerator_H
68 
69 #include "zoneGenerator.H"
70 
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73 namespace Foam
74 {
75 namespace zoneGenerators
76 {
77 
78 /*---------------------------------------------------------------------------*\
79  Class set Declaration
80 \*---------------------------------------------------------------------------*/
81 
82 class set
83 :
84  public zoneGenerator
85 {
86  // Private Data
87 
88  //- Type of the set and corresponding zone
89  zoneTypes zoneType_;
90 
91  //- Name of the set to be converted
92  // Defaults to the name of the zone
93  const word setName_;
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("set");
100 
101 
102  // Constructors
103 
104  //- Construct from dictionary
105  set
106  (
107  const word& name,
108  const polyMesh& mesh,
109  const dictionary& dict
110  );
111 
112 
113  //- Destructor
114  virtual ~set();
115 
116 
117  // Member Functions
118 
119  virtual zoneSet generate() const;
120 };
121 
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 } // End namespace zoneGenerators
126 } // End namespace Foam
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 #endif
131 
132 // ************************************************************************* //
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
A class for handling words, derived from string.
Definition: word.H:62
const word & name() const
virtual zoneSet generate() const
Generate and return the zoneSet.
Definition: set.C:68
TypeName("set")
Runtime type information.
set(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
Definition: set.C:48
virtual ~set()
Destructor.
Definition: set.C:62
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
Enumeration defining the zone types.
Definition: zoneSet.H:66
dictionary dict