refinementParameters.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
6  \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
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 #include "wordPairHashTable.H"
42 #include "surfaceZonesInfo.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 // Class forward declarations
50 class polyMesh;
51 
52 /*---------------------------------------------------------------------------*\
53  Class refinementParameters Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 {
58  // Private data
59 
60  //- Total number of cells
61  const label maxGlobalCells_;
62 
63  //- Per processor max number of cells
64  const label maxLocalCells_;
65 
66  //- When to stop refining
67  const label minRefineCells_;
68 
69  //- Curvature
70  scalar curvature_;
71 
72  //- Planarity criterion
73  scalar planarAngle_;
74 
75  //- Number of layers between different refinement levels
76  const label nBufferLayers_;
77 
78 
79  // Selection of areas
80 
81  //- Areas not to keep
83 
84  //- Areas to keep
86 
87  //- Region for location
89 
90  //- Information on how to handle faces on faceZones
92 
93 
94  //- FaceZone faces allowed which have owner and neighbour in same
95  // cellZone?
97 
98  //- Use old topology based problem-cell removal (cells with 8 points
99  // on surface)
101 
102  //- Allowed load unbalance
103  scalar maxLoadUnbalance_;
104 
106 
108 
109  // Private Member Functions
110 
111  //- Disallow default bitwise copy construct
113 
114  //- Disallow default bitwise assignment
115  void operator=(const refinementParameters&);
116 
117 
118 public:
119 
120  // Constructors
121 
122  //- Construct from dictionary - new syntax
124 
125 
126  // Member Functions
127 
128  // Access
129 
130  //- Total number of cells
131  label maxGlobalCells() const
132  {
133  return maxGlobalCells_;
134  }
135 
136  //- Per processor max number of cells
137  label maxLocalCells() const
138  {
139  return maxLocalCells_;
140  }
141 
142  //- When to stop refining
143  label minRefineCells() const
144  {
145  return minRefineCells_;
146  }
147 
148  //- Curvature
149  scalar curvature() const
150  {
151  return curvature_;
152  }
153 
154  //- Angle when two intersections are considered to be planar
155  scalar planarAngle() const
156  {
157  return planarAngle_;
158  }
159 
160  //- Number of layers between different refinement levels
161  label nBufferLayers() const
162  {
163  return nBufferLayers_;
164  }
165 
166  //- Areas to keep
167  const pointField& locationsInMesh() const
168  {
169  return locationsInMesh_;
170  }
171 
172  //- Per area the zone name
173  const wordList& zonesInMesh() const
174  {
175  return zonesInMesh_;
176  }
177 
178  //- Optional points which are checked to be outside the mesh
179  const pointField& locationsOutsideMesh() const
180  {
181  return locationsOutsideMesh_;
182  }
183 
184  //- Are zone faces allowed only inbetween different cell zones
185  // or also just free standing?
186  bool allowFreeStandingZoneFaces() const
187  {
189  }
190 
191  //- Use old topology based problem-cell removal
192  // (cells with 8 points on surface)
193  bool useTopologicalSnapDetection() const
194  {
196  }
197 
198  //- Allowed load unbalance
199  scalar maxLoadUnbalance() const
200  {
201  return maxLoadUnbalance_;
202  }
203 
204  bool handleSnapProblems() const
205  {
206  return handleSnapProblems_;
207  }
208 
209  //- Refine cell with opposite faces with different refinement level
210  bool interfaceRefine() const
211  {
212  return interfaceRefine_;
213  }
214 
215 
216  // Other
217 
218  //- Get patchInfo and faceType for faceZone
220  (
221  const word& fzName,
223  ) const;
224 
225  //- Add cellZones to mesh. Return indices of cellZones (or -1)
227 
228  //- Checks that cells are in mesh. Returns cells (or -1) they
229  // are in.
230  static labelList findCells
231  (
232  const bool checkInsideMesh,
233  const polyMesh&,
234  const pointField& locations
235  );
236 
237  //- Extract indices of named locations (so excludes 'keepPoints')
239 
240  //- Extract indices of unnamed locations ('keepPoints')
242 
243 };
244 
245 
246 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
247 
248 } // End namespace Foam
249 
250 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
251 
252 #endif
253 
254 // ************************************************************************* //
Foam::refinementParameters::allowFreeStandingZoneFaces
bool allowFreeStandingZoneFaces() const
Are zone faces allowed only inbetween different cell zones.
Definition: refinementParameters.H:185
Foam::refinementParameters::zonedLocations
static labelList zonedLocations(const wordList &zonesInMesh)
Extract indices of named locations (so excludes 'keepPoints')
Definition: refinementParameters.C:234
Foam::refinementParameters::zonesInMesh
const wordList & zonesInMesh() const
Per area the zone name.
Definition: refinementParameters.H:172
Foam::refinementParameters::useTopologicalSnapDetection
bool useTopologicalSnapDetection() const
Use old topology based problem-cell removal.
Definition: refinementParameters.H:192
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:60
Foam::refinementParameters::maxGlobalCells
label maxGlobalCells() const
Total number of cells.
Definition: refinementParameters.H:130
Foam::refinementParameters::maxLoadUnbalance_
scalar maxLoadUnbalance_
Allowed load unbalance.
Definition: refinementParameters.H:102
Foam::refinementParameters::faceZoneControls_
dictionary faceZoneControls_
Information on how to handle faces on faceZones.
Definition: refinementParameters.H:90
Foam::refinementParameters::maxLoadUnbalance
scalar maxLoadUnbalance() const
Allowed load unbalance.
Definition: refinementParameters.H:198
Foam::surfaceZonesInfo::faceZoneType
faceZoneType
What to do with faceZone faces.
Definition: surfaceZonesInfo.H:73
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::refinementParameters::useTopologicalSnapDetection_
Switch useTopologicalSnapDetection_
Use old topology based problem-cell removal (cells with 8 points.
Definition: refinementParameters.H:99
Foam::refinementParameters::planarAngle
scalar planarAngle() const
Angle when two intersections are considered to be planar.
Definition: refinementParameters.H:154
Foam::refinementParameters::locationsOutsideMesh_
const pointField locationsOutsideMesh_
Areas not to keep.
Definition: refinementParameters.H:81
Foam::refinementParameters::findCells
static labelList findCells(const bool checkInsideMesh, const polyMesh &, const pointField &locations)
Checks that cells are in mesh. Returns cells (or -1) they.
Definition: refinementParameters.C:174
Foam::refinementParameters::curvature_
scalar curvature_
Curvature.
Definition: refinementParameters.H:69
Foam::refinementParameters::zonesInMesh_
wordList zonesInMesh_
Region for location.
Definition: refinementParameters.H:87
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::refinementParameters::handleSnapProblems_
Switch handleSnapProblems_
Definition: refinementParameters.H:104
Foam::label
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
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::refinementParameters::maxLocalCells
label maxLocalCells() const
Per processor max number of cells.
Definition: refinementParameters.H:136
Foam::refinementParameters::nBufferLayers
label nBufferLayers() const
Number of layers between different refinement levels.
Definition: refinementParameters.H:160
Foam::refinementParameters::refinementParameters
refinementParameters(const refinementParameters &)
Disallow default bitwise copy construct.
Foam::refinementParameters::unzonedLocations
static labelList unzonedLocations(const wordList &zonesInMesh)
Extract indices of unnamed locations ('keepPoints')
Definition: refinementParameters.C:256
Foam::refinementParameters::maxLocalCells_
const label maxLocalCells_
Per processor max number of cells.
Definition: refinementParameters.H:63
Switch.H
Foam::refinementParameters
Simple container to keep together refinement specific information.
Definition: refinementParameters.H:55
Foam::refinementParameters::curvature
scalar curvature() const
Curvature.
Definition: refinementParameters.H:148
surfaceZonesInfo.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::refinementParameters::planarAngle_
scalar planarAngle_
Planarity criterion.
Definition: refinementParameters.H:72
Foam::refinementParameters::locationsOutsideMesh
const pointField & locationsOutsideMesh() const
Optional points which are checked to be outside the mesh.
Definition: refinementParameters.H:178
Foam::refinementParameters::interfaceRefine
bool interfaceRefine() const
Refine cell with opposite faces with different refinement level.
Definition: refinementParameters.H:209
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::refinementParameters::minRefineCells_
const label minRefineCells_
When to stop refining.
Definition: refinementParameters.H:66
Foam::refinementParameters::interfaceRefine_
Switch interfaceRefine_
Definition: refinementParameters.H:106
Foam::refinementParameters::handleSnapProblems
bool handleSnapProblems() const
Definition: refinementParameters.H:203
pointField.H
Foam::refinementParameters::locationsInMesh_
pointField locationsInMesh_
Areas to keep.
Definition: refinementParameters.H:84
wordPairHashTable.H
Foam::refinementParameters::getZoneInfo
dictionary getZoneInfo(const word &fzName, surfaceZonesInfo::faceZoneType &faceType) const
Get patchInfo and faceType for faceZone.
Definition: refinementParameters.C:123
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
dictionary.H
Foam::refinementParameters::maxGlobalCells_
const label maxGlobalCells_
Total number of cells.
Definition: refinementParameters.H:60
Foam::refinementParameters::allowFreeStandingZoneFaces_
Switch allowFreeStandingZoneFaces_
FaceZone faces allowed which have owner and neighbour in same.
Definition: refinementParameters.H:95
Foam::refinementParameters::addCellZonesToMesh
labelList addCellZonesToMesh(polyMesh &) const
Add cellZones to mesh. Return indices of cellZones (or -1)
Definition: refinementParameters.C:152
Foam::refinementParameters::locationsInMesh
const pointField & locationsInMesh() const
Areas to keep.
Definition: refinementParameters.H:166
Foam::refinementParameters::nBufferLayers_
const label nBufferLayers_
Number of layers between different refinement levels.
Definition: refinementParameters.H:75
Foam::refinementParameters::minRefineCells
label minRefineCells() const
When to stop refining.
Definition: refinementParameters.H:142
Foam::refinementParameters::operator=
void operator=(const refinementParameters &)
Disallow default bitwise assignment.