extrudePatchMesh.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2016 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::extrudePatchMesh
26 
27 Description
28  Mesh at a patch created on the fly. The following entry should be used
29  on the field boundary dictionary:
30 
31  Example:
32  \verbatim
33  // New Shell mesh data
34 
35  extrudeModel linearNormal;
36  linearNormalCoeffs
37  {
38  thickness 40e-6;
39  }
40  nLayers 50;
41  expansionRatio 1;
42  columnCells true;
43 
44  // Patch information
45  bottomCoeffs
46  {
47  name "bottom";
48  type mappedWall;
49  sampleMode nearestPatchFace;
50  samplePatch fixedWalls;
51  offsetMode uniform;
52  offset (0 0 0);
53  }
54 
55  topCoeffs
56  {
57  name "top";
58  type patch;
59  }
60 
61  sideCoeffs
62  {
63  name "side";
64  type empty;
65  }
66  \endverbatim
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef extrudePatchMesh_H
71 #define extrudePatchMesh_H
72 
73 #include "extrudeModel.H"
74 #include "autoPtr.H"
75 
76 #include "fvMesh.H"
77 #include "Time.H"
78 
79 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
80 
81 namespace Foam
82 {
83 
84 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85 
86 
87 /*---------------------------------------------------------------------------*\
88  Class extrudePatchMesh Declaration
89 \*---------------------------------------------------------------------------*/
90 
91 class extrudePatchMesh
92 :
93  public fvMesh
94 {
95 
96 private:
97 
98  // Private data
99 
100  //- Enumeration of patch IDs
101  enum patchID
102  {
103  bottomPatchID,
104  topPatchID,
105  sidePatchID
106  };
107 
108  //- Const reference to the patch from which this mesh is extruded
109  const polyPatch& extrudedPatch_;
110 
111  //- Model dictionary
112  dictionary dict_;
113 
114 
115  // Private member functions
116 
117  //- Extrude mesh using polyPatches
118  void extrudeMesh(const List<polyPatch*>& regionPatches);
119 
120 
121 public:
122 
123  //- Runtime type information
124  TypeName("extrudePatchMesh");
125 
126 
127  // Constructors
128 
129  //- Construct from mesh, patch and dictionary
131  (
132  const fvMesh&,
133  const fvPatch&,
134  const dictionary&,
135  const word
136  );
137 
138  //- Construct from mesh, patch, dictionary and new mesh
139  // polyPatch information
141  (
142  const fvMesh&,
143  const fvPatch&,
144  const dictionary&,
145  const word,
146  const List<polyPatch*>& polyPatches
147  );
148 
149 
150  //- Destructor
151  virtual ~extrudePatchMesh();
152 
153 
154  // Member functions
155 
156 
157  // Access functions
158 
159  //- Return region mesh
160  const fvMesh& regionMesh() const
161  {
162  return *this;
163  }
164 
165  //- Return bottom patch
166  const polyPatch& bottomPatch() const
167  {
168  return this->boundaryMesh()[bottomPatchID];
169  }
170 
171  //- Return top patch
172  const polyPatch& topPatch() const
173  {
174  return this->boundaryMesh()[topPatchID];
175  }
176 
177  //- Return sides patch
178  const polyPatch& sidesPatch() const
179  {
180  return this->boundaryMesh()[sidePatchID];
181  }
182 
183  //- Return extruded patch
184  const polyPatch& extrudedPatch() const
185  {
186  return extrudedPatch_;
187  }
188 
189 };
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 } // End namespace Foam
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #endif
198 
199 // ************************************************************************* //
const polyPatch & topPatch() const
Return top patch.
extrudePatchMesh(const fvMesh &, const fvPatch &, const dictionary &, const word)
Construct from mesh, patch and dictionary.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Mesh at a patch created on the fly. The following entry should be used on the field boundary dictiona...
const polyPatch & bottomPatch() const
Return bottom patch.
TypeName("extrudePatchMesh")
Runtime type information.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Definition: polyMesh.H:421
A class for handling words, derived from string.
Definition: word.H:59
const fvMesh & regionMesh() const
Return region mesh.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
virtual ~extrudePatchMesh()
Destructor.
const polyPatch & sidesPatch() const
Return sides patch.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Namespace for OpenFOAM.
const polyPatch & extrudedPatch() const
Return extruded patch.