ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / mesh / autoMesh / autoHexMesh / autoHexMeshDriver / layerParameters / layerParameters.H
blobe6324131e94d8becf1626518c29eab68bf556c0c
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_;
108         Switch additionalReporting_;
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             const Switch& additionalReporting() const
264             {
265                 return additionalReporting_;
266             }
269             // Overall
271                 //- Number of overall layer addition iterations
272                 label nLayerIter() const
273                 {
274                     return nLayerIter_;
275                 }
277                 //- Number of iterations after which relaxed motion rules
278                 //  are to be used.
279                 label nRelaxedIter() const
280                 {
281                     return nRelaxedIter_;
282                 }
289 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
291 } // End namespace Foam
293 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
295 #endif
297 // ************************************************************************* //