extrude2DMesh.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) 2011-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::extrude2DMesh
26 
27 Description
28  Given a 2D mesh insert all the topology changes to extrude. Does not work
29  in parallel.
30 
31 SourceFiles
32  extrude2DMesh.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef extrude2DMesh_H
37 #define extrude2DMesh_H
38 
39 #include "typeInfo.H"
40 #include "label.H"
41 #include "scalar.H"
42 #include "labelList.H"
43 #include "dictionary.H"
44 #include "HashSet.H"
45 #include "extrudeModel.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 // Forward declaration of classes
53 class polyMesh;
54 class polyTopoChange;
55 class polyTopoChangeMap;
56 class polyDistributionMap;
57 class polyBoundaryMesh;
58 
59 /*---------------------------------------------------------------------------*\
60  Class extrude2DMesh Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 class extrude2DMesh
64 {
65  // Private Data
66 
67  //- Reference to 2D mesh
68  polyMesh& mesh_;
69 
70  const extrudeModel& model_;
71 
72  const word patchType_;
73 
74  label frontPatchi_;
75 
76  label backPatchi_;
77 
78  //- Zones of the added cells
79  List<labelHashSet> cellZonesAddedCells_;
80 
81 
82  // Private Member Functions
83 
84  //- Check the mesh is 2D
85  void check2D() const;
86 
87 
88 public:
89 
90  //- Runtime type information
91  ClassName("extrude2DMesh");
92 
93 
94  // Constructors
96  (
97  polyMesh&,
98  const dictionary& dict,
99  const extrudeModel& model
100  );
101 
102  //- Disallow default bitwise copy construction
103  extrude2DMesh(const extrude2DMesh&) = delete;
104 
105 
106  //- Destructor
107  ~extrude2DMesh();
108 
109 
110  // Member Functions
111 
112  //- Add front and back patches
113  void addFrontBackPatches();
114 
115  label frontPatchi() const
116  {
117  return frontPatchi_;
118  }
119 
120  label backPatchi() const
121  {
122  return backPatchi_;
123  }
124 
125  //- Play commands into polyTopoChange to extrude mesh.
127 
128  //- Update the mesh zones
129  // adding the point and cell zones for the added layer
130  void updateZones();
131 
132 
133  // Member Operators
134 
135  //- Disallow default bitwise assignment
136  void operator=(const extrude2DMesh&) = delete;
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #endif
147 
148 // ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:91
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Given a 2D mesh insert all the topology changes to extrude. Does not work in parallel.
Definition: extrude2DMesh.H:63
extrude2DMesh(polyMesh &, const dictionary &dict, const extrudeModel &model)
void updateZones()
Update the mesh zones.
label frontPatchi() const
ClassName("extrude2DMesh")
Runtime type information.
label backPatchi() const
~extrude2DMesh()
Destructor.
void setRefinement(polyTopoChange &)
Play commands into polyTopoChange to extrude mesh.
void operator=(const extrude2DMesh &)=delete
Disallow default bitwise assignment.
void addFrontBackPatches()
Add front and back patches.
Top level extrusion model class.
Definition: extrudeModel.H:52
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
Direct mesh changes based on v1.3 polyTopoChange syntax.
A class for handling words, derived from string.
Definition: word.H:62
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
Basic run-time type information using word as the type's name. Used to enhance the standard RTTI to c...