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-2024 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 "extrudeModel.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 // Forward declaration of classes
52 class polyMesh;
53 class polyTopoChange;
54 class polyTopoChangeMap;
55 class polyDistributionMap;
56 class polyBoundaryMesh;
57 
58 /*---------------------------------------------------------------------------*\
59  Class extrude2DMesh Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class extrude2DMesh
63 {
64  // Private Data
65 
66  //- Reference to 2D mesh
67  polyMesh& mesh_;
68 
69  const dictionary dict_;
70 
71  const extrudeModel& model_;
72 
73  const word modelType_;
74 
75  const word patchType_;
76 
77  label frontPatchi_;
78 
79  label backPatchi_;
80 
81  //- Zones of the added cells
82  List<labelHashSet> cellZonesAddedCells_;
83 
84 
85  // Private Member Functions
86 
87  //- Check the mesh is 2D
88  void check2D() const;
89 
90 
91 public:
92 
93  //- Runtime type information
94  ClassName("extrude2DMesh");
95 
96 
97  // Constructors
99  (
100  polyMesh&,
101  const dictionary& dict,
102  const extrudeModel& model
103  );
104 
105  //- Disallow default bitwise copy construction
106  extrude2DMesh(const extrude2DMesh&) = delete;
107 
108 
109  //- Destructor
110  ~extrude2DMesh();
111 
112 
113  // Member Functions
114 
115  //- Add front and back patches
116  void addFrontBackPatches();
117 
118  label frontPatchi() const
119  {
120  return frontPatchi_;
121  }
122 
123  label backPatchi() const
124  {
125  return backPatchi_;
126  }
127 
128  //- Play commands into polyTopoChange to extrude mesh.
130 
131  //- Update the mesh zones
132  // adding the point and cell zones for the added layer
133  void updateZones();
134 
135 
136  // Member Operators
137 
138  //- Disallow default bitwise assignment
139  void operator=(const extrude2DMesh&) = delete;
140 };
141 
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 } // End namespace Foam
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 #endif
150 
151 // ************************************************************************* //
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 keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Given a 2D mesh insert all the topology changes to extrude. Does not work in parallel.
Definition: extrude2DMesh.H:62
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...