1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
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
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/>.
28 Encapsulates queries for volume refinement ('refine all cells within
34 \*---------------------------------------------------------------------------*/
36 #ifndef shellSurfaces_H
37 #define shellSurfaces_H
39 #include "searchableSurface.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 class searchableSurfaces;
49 /*---------------------------------------------------------------------------*\
50 Class shellSurfaces Declaration
51 \*---------------------------------------------------------------------------*/
59 //- Volume refinement controls
62 INSIDE, // Refine all inside shell
63 OUTSIDE, // ,, outside
64 DISTANCE // Refine based on distance to shell
72 //- Reference to all geometry.
73 const searchableSurfaces& allGeometry_;
75 //- Indices of surfaces that are shells
78 //- Per shell whether to refine inside or outside
79 List<refineMode> modes_;
81 //- Per shell the list of ranges
82 List<scalarField> distances_;
84 //- Per shell per distance the refinement level
85 labelListList levels_;
91 static const NamedEnum<refineMode, 3> refineModeNames_;
94 // Private Member Functions
96 //- Helper function for initialisation.
97 void setAndCheckLevels
100 const List<Tuple2<scalar, label> >&
107 const pointField& pt,
116 //- Construct from components
119 const searchableSurfaces& allGeometry,
120 const labelList& shells,
121 const List<refineMode>& modes,
122 const List<scalarField>& distances,
123 const labelListList& levels
126 //- Construct from geometry and dictionaries
129 const searchableSurfaces& allGeometry,
130 const PtrList<dictionary>& shellDicts
133 //- Construct from geometry and dictionary
136 const searchableSurfaces& allGeometry,
137 const dictionary& shellsDict
145 //const List<scalarField>& distances() const
147 // return distances_;
150 ////- Per shell per distance the refinement level
151 //const labelListList& levels() const
159 //- Highest shell level
160 label maxLevel() const;
162 //- Find shell level higher than ptLevel
165 const pointField& pt,
166 const labelList& ptLevel,
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 } // End namespace Foam
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 // ************************************************************************* //