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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::extrudePatchMesh
28 
29 Description
30  Mesh at a patch created on the fly. The following entry should be used
31  on the field boundary dictionary:
32 
33  Example:
34  \verbatim
35  // New Shell mesh data
36 
37  extrudeModel linearNormal;
38  linearNormalCoeffs
39  {
40  thickness 40e-6;
41  }
42  nLayers 50;
43  expansionRatio 1;
44  columnCells true;
45 
46  // Patch information
47  bottomCoeffs
48  {
49  name "bottom";
50  type mappedWall;
51  sampleMode nearestPatchFace;
52  samplePatch fixedWalls;
53  offsetMode uniform;
54  offset (0 0 0);
55  }
56 
57  topCoeffs
58  {
59  name "top";
60  type patch;
61  }
62 
63  sideCoeffs
64  {
65  name "side";
66  type empty;
67  }
68  \endverbatim
69 
70 \*---------------------------------------------------------------------------*/
71 
72 #ifndef extrudePatchMesh_H
73 #define extrudePatchMesh_H
74 
75 #include "extrudeModel.H"
76 #include "autoPtr.H"
77 
78 #include "fvMesh.H"
79 #include "Time.H"
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 namespace Foam
84 {
85 
86 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
87 
88 
89 /*---------------------------------------------------------------------------*\
90  Class extrudePatchMesh Declaration
91 \*---------------------------------------------------------------------------*/
92 
93 class extrudePatchMesh
94 :
95  public fvMesh
96 {
97 
98 private:
99 
100  // Private data
101 
102  //- Enumeration of patch IDs
103  enum patchID
104  {
105  bottomPatchID,
106  topPatchID,
107  sidePatchID
108  };
109 
110  //- Const reference to the patch from which this mesh is extruded
111  const polyPatch& extrudedPatch_;
112 
113  //- Model dictionary
114  dictionary dict_;
115 
116 
117  // Private member functions
118 
119  //- Extrude mesh using polyPatches
120  void extrudeMesh(const List<polyPatch*>& regionPatches);
121 
122 
123 public:
124 
125  //- Runtime type information
126  TypeName("extrudePatchMesh");
127 
128 
129  // Constructors
130 
131  //- Construct from mesh, patch and dictionary
133  (
134  const fvMesh&,
135  const fvPatch&,
136  const dictionary&,
137  const word
138  );
139 
140  //- Construct from mesh, patch, dictionary and new mesh
141  // polyPatch information
143  (
144  const fvMesh&,
145  const fvPatch&,
146  const dictionary&,
147  const word,
148  const List<polyPatch*>& polyPatches
149  );
150 
151 
152  //- Destructor
153  virtual ~extrudePatchMesh() = default;
154 
155 
156  // Member functions
157 
158 
159  // Access functions
160 
161  //- Return region mesh
162  const fvMesh& regionMesh() const
163  {
164  return *this;
165  }
166 
167  //- Return bottom patch
168  const polyPatch& bottomPatch() const
169  {
170  return this->boundaryMesh()[bottomPatchID];
171  }
172 
173  //- Return top patch
174  const polyPatch& topPatch() const
175  {
176  return this->boundaryMesh()[topPatchID];
177  }
178 
179  //- Return sides patch
180  const polyPatch& sidesPatch() const
181  {
182  return this->boundaryMesh()[sidePatchID];
183  }
184 
185  //- Return extruded patch
186  const polyPatch& extrudedPatch() const
187  {
188  return extrudedPatch_;
189  }
190 
191 };
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 } // End namespace Foam
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 #endif
200 
201 // ************************************************************************* //
Foam::extrudePatchMesh::extrudedPatch
const polyPatch & extrudedPatch() const
Return extruded patch.
Definition: extrudePatchMesh.H:185
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::polyMesh::boundaryMesh
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Definition: polyMesh.H:435
Foam::extrudePatchMesh::topPatch
const polyPatch & topPatch() const
Return top patch.
Definition: extrudePatchMesh.H:173
Foam::extrudePatchMesh::regionMesh
const fvMesh & regionMesh() const
Return region mesh.
Definition: extrudePatchMesh.H:161
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:63
Foam::extrudePatchMesh::~extrudePatchMesh
virtual ~extrudePatchMesh()=default
Destructor.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
fvMesh.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Time.H
Foam::extrudePatchMesh::extrudePatchMesh
extrudePatchMesh(const fvMesh &, const fvPatch &, const dictionary &, const word)
Construct from mesh, patch and dictionary.
Definition: extrudePatchMesh.C:79
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:102
Foam::extrudePatchMesh::sidesPatch
const polyPatch & sidesPatch() const
Return sides patch.
Definition: extrudePatchMesh.H:179
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:92
Foam::extrudePatchMesh::bottomPatch
const polyPatch & bottomPatch() const
Return bottom patch.
Definition: extrudePatchMesh.H:167
autoPtr.H