shellSurfaces.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Class
25  Foam::shellSurfaces
26 
27 Description
28  Encapsulates queries for volume refinement ('refine all cells within
29  shell').
30 
31 SourceFiles
32  shellSurfaces.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef shellSurfaces_H
37 #define shellSurfaces_H
38 
39 #include "searchableSurface.H"
40 #include "Tuple2.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 class searchableSurfaces;
48 
49 /*---------------------------------------------------------------------------*\
50  Class shellSurfaces Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class shellSurfaces
54 {
55 public:
56 
57  // Public data types
58 
59  //- Volume refinement controls
60  enum refineMode
61  {
62  INSIDE, // Refine all inside shell
63  OUTSIDE, // ,, outside
64  DISTANCE // Refine based on distance to shell
65  };
66 
67 
68 private:
69 
70  // Private data
71 
72  //- Reference to all geometry.
73  const searchableSurfaces& allGeometry_;
74 
75  //- Indices of surfaces that are shells
76  labelList shells_;
77 
78  //- Per shell whether to refine inside or outside
79  List<refineMode> modes_;
80 
81  //- Per shell the list of ranges
82  List<scalarField> distances_;
83 
84  //- Per shell per distance the refinement level
85  labelListList levels_;
86 
87 
88  // Private data
89 
90  //- refineMode names
91  static const NamedEnum<refineMode, 3> refineModeNames_;
92 
93 
94  // Private Member Functions
95 
96  //- Helper function for initialisation.
97  void setAndCheckLevels
98  (
99  const label shellI,
101  );
102 
103  void orient();
104 
105  void findHigherLevel
106  (
107  const pointField& pt,
108  const label shellI,
110  ) const;
111 
112 public:
113 
114  // Constructors
115 
116  //- Construct from geometry and dictionary
118  (
119  const searchableSurfaces& allGeometry,
120  const dictionary& shellsDict
121  );
122 
123 
124  // Member Functions
125 
126  // Access
127 
128  // const List<scalarField>& distances() const
129  //{
130  // return distances_;
131  //}
132  //
134  // const labelListList& levels() const
135  //{
136  // return levels_;
137  //}
138 
139 
140  // Query
141 
142  //- Highest shell level
143  label maxLevel() const;
144 
145  //- Find shell level higher than ptLevel
146  void findHigherLevel
147  (
148  const pointField& pt,
149  const labelList& ptLevel,
151  ) const;
152 
153 };
154 
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #endif
163 
164 // ************************************************************************* //
shellSurfaces(const searchableSurfaces &allGeometry, const dictionary &shellsDict)
Construct from geometry and dictionary.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
A 2-tuple for storing two objects of different types.
Definition: HashTable.H:66
refineMode
Volume refinement controls.
Definition: shellSurfaces.H:59
label maxLevel() const
Highest shell level.
Container for searchableSurfaces.
Encapsulates queries for volume refinement (&#39;refine all cells within shell&#39;).
Definition: shellSurfaces.H:52
Namespace for OpenFOAM.