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-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::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  // Private Member Functions
93 
94  //- Disallow default bitwise copy construct
96 
97  //- Disallow default bitwise assignment
98  void operator=(const refinementParameters&);
99 
100 
101 public:
102 
103  // Constructors
104 
105  //- Construct from dictionary - new syntax
107 
108 
109  // Member Functions
110 
111  // Access
112 
113  //- Total number of cells
114  label maxGlobalCells() const
115  {
116  return maxGlobalCells_;
117  }
118 
119  //- Per processor max number of cells
120  label maxLocalCells() const
121  {
122  return maxLocalCells_;
123  }
124 
125  //- When to stop refining
126  label minRefineCells() const
127  {
128  return minRefineCells_;
129  }
130 
131  //- Curvature
132  scalar curvature() const
133  {
134  return curvature_;
135  }
136 
137  //- Angle when two intersections are considered to be planar
138  scalar planarAngle() const
139  {
140  return planarAngle_;
141  }
142 
143  //- Number of layers between different refinement levels
144  label nBufferLayers() const
145  {
146  return nBufferLayers_;
147  }
148 
149  //- Areas to keep
150  const pointField& keepPoints() const
151  {
152  return keepPoints_;
153  }
154 
155  //- Are zone faces allowed only in between different cell zones
156  // or also just free standing?
157  bool allowFreeStandingZoneFaces() const
158  {
159  return allowFreeStandingZoneFaces_;
160  }
161 
162  //- Use old topology based problem-cell removal
163  // (cells with 8 points on surface)
164  bool useTopologicalSnapDetection() const
165  {
166  return useTopologicalSnapDetection_;
167  }
168 
169  //- Allowed load unbalance
170  scalar maxLoadUnbalance() const
171  {
172  return maxLoadUnbalance_;
173  }
175  bool handleSnapProblems() const
176  {
177  return handleSnapProblems_;
178  }
179 
180 
181  // Other
182 
183  //- Checks that cells are in mesh. Returns cells they are in.
184  labelList findCells(const polyMesh&) const;
185 
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
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
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.
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.
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.