Transferred copyright to the OpenFOAM Foundation
[OpenFOAM-2.0.x.git] / src / mesh / autoMesh / autoHexMesh / autoHexMeshDriver / layerParameters / layerParameters.H
blob58937bf69fd6f897d32ea15cc19a73f2cec7bff0
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
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
13     the Free Software Foundation, either version 3 of the License, or
14     (at your 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, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::layerParameters
27 Description
28     Simple container to keep together layer specific information.
30 SourceFiles
31     layerParameters.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef layerParameters_H
36 #define layerParameters_H
38 #include "dictionary.H"
39 #include "scalarField.H"
40 #include "labelList.H"
41 #include "Switch.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 // Class forward declarations
49 class polyBoundaryMesh;
50 class refinementSurfaces;
52 /*---------------------------------------------------------------------------*\
53                            Class layerParameters Declaration
54 \*---------------------------------------------------------------------------*/
56 class layerParameters
58     // Static data members
60         //- Default angle for faces to be convcave
61         static const scalar defaultConcaveAngle;
64     // Private data
66         // Per patch (not region!) information
68             //- How many layers to add.
69             labelList numLayers_;
71             scalarField expansionRatio_;
73             Switch relativeSizes_;
75             scalarField finalLayerThickness_;
77             scalarField minThickness_;
80         scalar featureAngle_;
82         scalar concaveAngle_;
84         label nGrow_;
86         label nSmoothSurfaceNormals_;
88         label nSmoothNormals_;
90         label nSmoothThickness_;
92         scalar maxFaceThicknessRatio_;
94         scalar layerTerminationCos_;
96         scalar maxThicknessToMedialRatio_;
98         scalar minMedianAxisAngleCos_;
100         label nBufferCellsNoExtrude_;
102         label nSnap_;
104         label nLayerIter_;
106         label nRelaxedIter_;
109     // Private Member Functions
111         //- Extract patch-wise number of layers
112         static labelList readNumLayers
113         (
114             const PtrList<dictionary>& surfaceDicts,
115             const refinementSurfaces& refineSurfaces,
116             const labelList& globalToPatch,
117             const polyBoundaryMesh& boundaryMesh
118         );
120         //- Disallow default bitwise copy construct
121         layerParameters(const layerParameters&);
123         //- Disallow default bitwise assignment
124         void operator=(const layerParameters&);
127 public:
129     // Constructors
131         //- Construct from dictionary - old syntax
132         layerParameters
133         (
134             const PtrList<dictionary>& surfaceDicts,
135             const refinementSurfaces& refineSurfaces,
136             const labelList& globalToPatch,
137             const dictionary& dict,
138             const polyBoundaryMesh& boundaryMesh
139         );
141         //- Construct from dictionary - new syntax
142         layerParameters(const dictionary& dict, const polyBoundaryMesh&);
145     // Member Functions
147         // Access
149             // Per patch information
151                 //- How many layers to add.
152                 const labelList& numLayers() const
153                 {
154                     return numLayers_;
155                 }
157                 // Expansion factor for layer mesh
158                 const scalarField& expansionRatio() const
159                 {
160                     return expansionRatio_;
161                 }
163                 //- Are size parameters relative to inner cell size or
164                 //  absolute distances.
165                 bool relativeSizes() const
166                 {
167                     return relativeSizes_;
168                 }
170                 //- Wanted thickness of final added cell layer. If multiple
171                 //  layers is the thickness of the layer furthest away
172                 //  from the wall (i.e. nearest the original mesh)
173                 //  If relativeSize() this number is relative to undistorted
174                 //  size of the cell outside layer.
175                 const scalarField& finalLayerThickness() const
176                 {
177                     return finalLayerThickness_;
178                 }
180                 //- Minimum thickness of cell layer. If for any reason layer
181                 //  cannot be above minThickness do not add layer.
182                 //  If relativeSize() this number is relative to undistorted
183                 //  size of the cell outside layer.
184                 const scalarField& minThickness() const
185                 {
186                     return minThickness_;
187                 }
190             scalar featureAngle() const
191             {
192                 return featureAngle_;
193             }
195             scalar concaveAngle() const
196             {
197                 return concaveAngle_;
198             }
200             //- If points get not extruded do nGrow layers of connected faces
201             //  that are not grown. Is used to not do layers at all close to
202             //  features.
203             label nGrow() const
204             {
205                 return nGrow_;
206             }
208             //- Number of smoothing iterations of surface normals
209             label nSmoothSurfaceNormals() const
210             {
211                 return nSmoothSurfaceNormals_;
212             }
214             //- Number of smoothing iterations of interior mesh movement
215             //  direction
216             label nSmoothNormals() const
217             {
218                 return nSmoothNormals_;
219             }
221             //- Stop layer growth on highly warped cells
222             scalar maxFaceThicknessRatio() const
223             {
224                 return maxFaceThicknessRatio_;
225             }
227             scalar layerTerminationCos() const
228             {
229                 return layerTerminationCos_;
230             }
232             //- Smooth layer thickness over surface patches
233             label nSmoothThickness() const
234             {
235                 return nSmoothThickness_;
236             }
238             //- Reduce layer growth where ratio thickness to medial
239             //  distance is large
240             scalar maxThicknessToMedialRatio() const
241             {
242                 return maxThicknessToMedialRatio_;
243             }
245             //- Angle used to pick up medial axis points
246             scalar minMedianAxisAngleCos() const
247             {
248                 return minMedianAxisAngleCos_;
249             }
251             //- Create buffer region for new layer terminations
252             label nBufferCellsNoExtrude() const
253             {
254                 return nBufferCellsNoExtrude_;
255             }
257             label nSnap() const
258             {
259                 return nSnap_;
260             }
262             // Overall
264                 //- Number of overall layer addition iterations
265                 label nLayerIter() const
266                 {
267                     return nLayerIter_;
268                 }
270                 //- Number of iterations after which relaxed motion rules
271                 //  are to be used.
272                 label nRelaxedIter() const
273                 {
274                     return nRelaxedIter_;
275                 }
282 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
284 } // End namespace Foam
286 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
288 #endif
290 // ************************************************************************* //