initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / autoMesh / autoHexMesh / autoHexMeshDriver / layerParameters / layerParameters.H
blob766897f43f83cc31b30ce3e2967d00edf15d7620
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::layerParameters
28 Description
29     Simple container to keep together layer specific information.
31 SourceFiles
32     layerParameters.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef layerParameters_H
37 #define layerParameters_H
39 #include "dictionary.H"
40 #include "scalarField.H"
41 #include "labelList.H"
42 #include "Switch.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 // Class forward declarations
50 class polyBoundaryMesh;
51 class refinementSurfaces;
53 /*---------------------------------------------------------------------------*\
54                            Class layerParameters Declaration
55 \*---------------------------------------------------------------------------*/
57 class layerParameters
59     // Static data members
61         //- Default angle for faces to be convcave
62         static const scalar defaultConcaveAngle;
65     // Private data
67         // Per patch (not region!) information
69             //- How many layers to add.
70             labelList numLayers_;
72             scalarField expansionRatio_;
74             Switch relativeSizes_;
76             scalarField finalLayerThickness_;
78             scalarField minThickness_;
81         scalar featureAngle_;
83         scalar concaveAngle_;
85         label nGrow_;
87         label nSmoothSurfaceNormals_;
89         label nSmoothNormals_;
91         label nSmoothThickness_;
93         scalar maxFaceThicknessRatio_;
95         scalar layerTerminationCos_;
97         scalar maxThicknessToMedialRatio_;
99         scalar minMedianAxisAngleCos_;
101         label nBufferCellsNoExtrude_;
103         label nSnap_;
105         label nLayerIter_;
107         label nRelaxedIter_;
110     // Private Member Functions
112         //- Extract patch-wise number of layers
113         static labelList readNumLayers
114         (
115             const PtrList<dictionary>& surfaceDicts,
116             const refinementSurfaces& refineSurfaces,
117             const labelList& globalToPatch,
118             const polyBoundaryMesh& boundaryMesh
119         );
121         //- Disallow default bitwise copy construct
122         layerParameters(const layerParameters&);
124         //- Disallow default bitwise assignment
125         void operator=(const layerParameters&);
128 public:
130     // Constructors
132         //- Construct from dictionary - old syntax
133         layerParameters
134         (
135             const PtrList<dictionary>& surfaceDicts,
136             const refinementSurfaces& refineSurfaces,
137             const labelList& globalToPatch,
138             const dictionary& dict,
139             const polyBoundaryMesh& boundaryMesh
140         );
142         //- Construct from dictionary - new syntax
143         layerParameters(const dictionary& dict, const polyBoundaryMesh&);
146     // Member Functions
148         // Access
150             // Per patch information
152                 //- How many layers to add.
153                 const labelList& numLayers() const
154                 {
155                     return numLayers_;
156                 }
158                 // Expansion factor for layer mesh
159                 const scalarField& expansionRatio() const
160                 {
161                     return expansionRatio_;
162                 }
164                 //- Are size parameters relative to inner cell size or
165                 //  absolute distances.
166                 bool relativeSizes() const
167                 {
168                     return relativeSizes_;
169                 }
171                 //- Wanted thickness of final added cell layer. If multiple
172                 //  layers is the thickness of the layer furthest away
173                 //  from the wall (i.e. nearest the original mesh)
174                 //  If relativeSize() this number is relative to undistorted
175                 //  size of the cell outside layer.
176                 const scalarField& finalLayerThickness() const
177                 {
178                     return finalLayerThickness_;
179                 }
181                 //- Minimum thickness of cell layer. If for any reason layer
182                 //  cannot be above minThickness do not add layer.
183                 //  If relativeSize() this number is relative to undistorted
184                 //  size of the cell outside layer.
185                 const scalarField& minThickness() const
186                 {
187                     return minThickness_;
188                 }
191             scalar featureAngle() const
192             {
193                 return featureAngle_;
194             }
196             scalar concaveAngle() const
197             {
198                 return concaveAngle_;
199             }
201             //- If points get not extruded do nGrow layers of connected faces
202             //  that are not grown. Is used to not do layers at all close to
203             //  features.
204             label nGrow() const
205             {
206                 return nGrow_;
207             }
209             //- Number of smoothing iterations of surface normals 
210             label nSmoothSurfaceNormals() const
211             {
212                 return nSmoothSurfaceNormals_;
213             }
215             //- Number of smoothing iterations of interior mesh movement
216             //  direction  
217             label nSmoothNormals() const
218             {
219                 return nSmoothNormals_;
220             }
222             //- Stop layer growth on highly warped cells 
223             scalar maxFaceThicknessRatio() const
224             {
225                 return maxFaceThicknessRatio_;
226             }
228             scalar layerTerminationCos() const
229             {
230                 return layerTerminationCos_;
231             }
233             //- Smooth layer thickness over surface patches
234             label nSmoothThickness() const
235             {
236                 return nSmoothThickness_;
237             }
239             //- Reduce layer growth where ratio thickness to medial 
240             //  distance is large 
241             scalar maxThicknessToMedialRatio() const
242             {
243                 return maxThicknessToMedialRatio_;
244             }
246             //- Angle used to pick up medial axis points
247             scalar minMedianAxisAngleCos() const
248             {
249                 return minMedianAxisAngleCos_;
250             }
252             //- Create buffer region for new layer terminations
253             label nBufferCellsNoExtrude() const
254             {
255                 return nBufferCellsNoExtrude_;
256             }
258             label nSnap() const
259             {
260                 return nSnap_;
261             }
263             // Overall
265                 //- Number of overall layer addition iterations
266                 label nLayerIter() const
267                 {
268                     return nLayerIter_;
269                 }
271                 //- Number of iterations after which relaxed motion rules
272                 //  are to be used.
273                 label nRelaxedIter() const
274                 {
275                     return nRelaxedIter_;
276                 }
283 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
285 } // End namespace Foam
287 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
289 #endif
291 // ************************************************************************* //