initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / autoMesh / autoHexMesh / shellSurfaces / shellSurfaces.H
blobce62de2bd597e59cd8c1cefa5ba5d222d4c30695
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::shellSurfaces
28 Description
29     Encapsulates queries for volume refinement ('refine all cells within
30     shell').
32 SourceFiles
33     shellSurfaces.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef shellSurfaces_H
38 #define shellSurfaces_H
40 #include "searchableSurface.H"
41 #include "Tuple2.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 class searchableSurfaces;
50 /*---------------------------------------------------------------------------*\
51                            Class shellSurfaces Declaration
52 \*---------------------------------------------------------------------------*/
54 class shellSurfaces
56 public:
58     // Public data types
60         //- Volume refinement controls
61         enum refineMode
62         {
63             INSIDE,         // Refine all inside shell
64             OUTSIDE,        // ,,         outside
65             DISTANCE        // Refine based on distance to shell
66         };
69 private:
71     // Private data
73         //- Reference to all geometry.
74         const searchableSurfaces& allGeometry_;
76         //- Indices of surfaces that are shells
77         labelList shells_;
79         //- Per shell whether to refine inside or outside
80         List<refineMode> modes_;
82         //- Per shell the list of ranges
83         List<scalarField> distances_;
85         //- Per shell per distance the refinement level
86         labelListList levels_;
89     // Private data
91         //- refineMode names
92         static const NamedEnum<refineMode, 3> refineModeNames_;
95     // Private Member Functions
97         //- Helper function for initialisation.
98         void setAndCheckLevels
99         (
100             const label shellI,
101             const List<Tuple2<scalar, label> >&
102         );
104         void orient();
106         void findHigherLevel
107         (
108             const pointField& pt,
109             const label shellI,
110             labelList& maxLevel
111         ) const;
113 public:
115     // Constructors
117         //- Construct from components
118         shellSurfaces
119         (
120             const searchableSurfaces& allGeometry,
121             const labelList& shells,
122             const List<refineMode>& modes,
123             const List<scalarField>& distances,
124             const labelListList& levels
125         );
127         //- Construct from geometry and dictionaries
128         shellSurfaces
129         (
130             const searchableSurfaces& allGeometry,
131             const PtrList<dictionary>& shellDicts
132         );
134         //- Construct from geometry and dictionary
135         shellSurfaces
136         (
137             const searchableSurfaces& allGeometry,
138             const dictionary& shellsDict
139         );
142     // Member Functions
144         // Access
146             //const List<scalarField>& distances() const
147             //{
148             //    return distances_;
149             //}
150             //
151             ////- Per shell per distance the refinement level
152             //const labelListList& levels() const
153             //{
154             //    return levels_;
155             //}
158         // Query
160             //- Highest shell level
161             label maxLevel() const;
163             //- Find shell level higher than ptLevel
164             void findHigherLevel
165             (
166                 const pointField& pt,
167                 const labelList& ptLevel,
168                 labelList& maxLevel
169             ) const;
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 } // End namespace Foam
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 #endif
182 // ************************************************************************* //