All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
refinementParameters.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-2019 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::refinementParameters
26 
27 Description
28  Simple container to keep together refinement specific information.
29 
30 SourceFiles
31  refinementParameters.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef refinementParameters_H
36 #define refinementParameters_H
37 
38 #include "dictionary.H"
39 #include "pointField.H"
40 #include "Switch.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // Class forward declarations
48 class polyMesh;
49 
50 /*---------------------------------------------------------------------------*\
51  Class refinementParameters Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 {
56  // Private Data
57 
58  //- Total number of cells
59  const label maxGlobalCells_;
60 
61  //- Per processor max number of cells
62  const label maxLocalCells_;
63 
64  //- When to stop refining
65  const label minRefineCells_;
66 
67  //- Curvature
68  scalar curvature_;
69 
70  //- Planarity criterion
71  scalar planarAngle_;
72 
73  //- Number of layers between different refinement levels
74  const label nBufferLayers_;
75 
76  //- Areas to keep
77  const pointField keepPoints_;
78 
79  //- FaceZone faces allowed which have owner and neighbour in same
80  // cellZone?
81  Switch allowFreeStandingZoneFaces_;
82 
83  //- Use old topology based problem-cell removal (cells with 8 points
84  // on surface)
85  Switch useTopologicalSnapDetection_;
86 
87  //- Allowed load unbalance
88  scalar maxLoadUnbalance_;
89 
90  Switch handleSnapProblems_;
91 
92 
93 public:
94 
95  // Constructors
96 
97  //- Construct from dictionary - new syntax
99 
100  //- Disallow default bitwise copy construction
102 
103 
104  // Member Functions
105 
106  // Access
107 
108  //- Total number of cells
109  label maxGlobalCells() const
110  {
111  return maxGlobalCells_;
112  }
113 
114  //- Per processor max number of cells
115  label maxLocalCells() const
116  {
117  return maxLocalCells_;
118  }
119 
120  //- When to stop refining
121  label minRefineCells() const
122  {
123  return minRefineCells_;
124  }
125 
126  //- Curvature
127  scalar curvature() const
128  {
129  return curvature_;
130  }
131 
132  //- Angle when two intersections are considered to be planar
133  scalar planarAngle() const
134  {
135  return planarAngle_;
136  }
137 
138  //- Number of layers between different refinement levels
139  label nBufferLayers() const
140  {
141  return nBufferLayers_;
142  }
143 
144  //- Areas to keep
145  const pointField& keepPoints() const
146  {
147  return keepPoints_;
148  }
149 
150  //- Are zone faces allowed only in between different cell zones
151  // or also just free standing?
152  bool allowFreeStandingZoneFaces() const
153  {
154  return allowFreeStandingZoneFaces_;
155  }
156 
157  //- Use old topology based problem-cell removal
158  // (cells with 8 points on surface)
159  bool useTopologicalSnapDetection() const
160  {
161  return useTopologicalSnapDetection_;
162  }
163 
164  //- Allowed load unbalance
165  scalar maxLoadUnbalance() const
166  {
167  return maxLoadUnbalance_;
168  }
170  bool handleSnapProblems() const
171  {
172  return handleSnapProblems_;
173  }
174 
175 
176  // Other
177 
178  //- Checks that cells are in mesh. Returns cells they are in.
179  labelList findCells(const polyMesh&) const;
180 
181 
182  // Member Operators
183 
184  //- Disallow default bitwise assignment
185  void operator=(const refinementParameters&) = delete;
186 };
187 
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 } // End namespace Foam
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 #endif
196 
197 // ************************************************************************* //
dictionary dict
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
void operator=(const refinementParameters &)=delete
Disallow default bitwise assignment.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
const pointField & keepPoints() const
Areas to keep.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
Definition: Switch.H:60
Simple container to keep together refinement specific information.
labelList findCells(const polyMesh &) const
Checks that cells are in mesh. Returns cells they are in.
label minRefineCells() const
When to stop refining.
bool allowFreeStandingZoneFaces() const
Are zone faces allowed only in between different cell zones.
bool useTopologicalSnapDetection() const
Use old topology based problem-cell removal.
label maxGlobalCells() const
Total number of cells.
scalar maxLoadUnbalance() const
Allowed load unbalance.
refinementParameters(const dictionary &dict)
Construct from dictionary - new syntax.
scalar planarAngle() const
Angle when two intersections are considered to be planar.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
scalar curvature() const
Curvature.
Namespace for OpenFOAM.
label maxLocalCells() const
Per processor max number of cells.
label nBufferLayers() const
Number of layers between different refinement levels.