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