snappyRefineDriver.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-2016 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::snappyRefineDriver
26 
27 Description
28 
29 SourceFiles
30  snappyRefineDriver.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef snappyRefineDriver_H
35 #define snappyRefineDriver_H
36 
37 #include "treeBoundBox.H"
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43 
44 // Forward declaration of classes
45 class refinementParameters;
46 class snapParameters;
47 
48 class meshRefinement;
49 class decompositionMethod;
50 class fvMeshDistribute;
51 
52 /*---------------------------------------------------------------------------*\
53  Class snappyRefineDriver Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 {
58  // Private data
59 
60  //- Mesh+surface
61  meshRefinement& meshRefiner_;
62 
63  //- Reference to decomposition method
64  decompositionMethod& decomposer_;
65 
66  //- Reference to mesh distribution engine
67  fvMeshDistribute& distributor_;
68 
69  //- From surface region to patch
70  const labelList globalToMasterPatch_;
71 
72  //- From surface region to patch
73  const labelList globalToSlavePatch_;
74 
75 
76  // Private Member Functions
77 
78  //- Refine all cells pierced by explicit feature edges
79  label featureEdgeRefine
80  (
81  const refinementParameters& refineParams,
82  const label maxIter,
83  const label minRefine
84  );
85 
86  //- Refine all cells interacting with the surface
87  label surfaceOnlyRefine
88  (
89  const refinementParameters& refineParams,
90  const label maxIter
91  );
92 
93  //- Refine all cells in small gaps
94  label gapOnlyRefine
95  (
96  const refinementParameters& refineParams,
97  const label maxIter
98  );
99 
100  //- Refine cells with almost all sides refined
101  label danglingCellRefine
102  (
103  const refinementParameters& refineParams,
104  const label nFaces,
105  const label maxIter
106  );
107 
108  //- Remove all cells within intersected region
109  void removeInsideCells
110  (
111  const refinementParameters& refineParams,
112  const label nBufferLayers
113  );
114 
115  //- Remove all cells inside/outside shell
116  label shellRefine
117  (
118  const refinementParameters& refineParams,
119  const label maxIter
120  );
121 
122  //- Add baffles and remove unreachable cells
123  void baffleAndSplitMesh
124  (
125  const refinementParameters& refineParams,
126  const snapParameters& snapParams,
127  const bool handleSnapProblems,
128  const dictionary& motionDict
129  );
130 
131  //- Add zones
132  void zonify(const refinementParameters& refineParams);
133 
134  void splitAndMergeBaffles
135  (
136  const refinementParameters& refineParams,
137  const snapParameters& snapParams,
138  const bool handleSnapProblems,
139  const dictionary& motionDict
140  );
141 
142  //- Merge refined boundary faces (from exposing coarser cell)
143  void mergePatchFaces
144  (
145  const refinementParameters& refineParams,
146  const dictionary& motionDict
147  );
148 
149 
150  //- Disallow default bitwise copy construct
152 
153  //- Disallow default bitwise assignment
154  void operator=(const snappyRefineDriver&);
155 
156 
157 public:
158 
159  //- Runtime type information
160  ClassName("snappyRefineDriver");
161 
162 
163  // Constructors
164 
165  //- Construct from components
167  (
168  meshRefinement& meshRefiner,
169  decompositionMethod& decomposer,
170  fvMeshDistribute& distributor,
171  const labelList& globalToMasterPatch,
172  const labelList& globalToSlavePatch
173  );
174 
175 
176  // Member Functions
177 
178  //- Do all the refinement
179  void doRefine
180  (
181  const dictionary& refineDict,
182  const refinementParameters& refineParams,
183  const snapParameters& snapParams,
184  const bool prepareForSnapping,
185  const dictionary& motionDict
186  );
187 };
188 
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 } // End namespace Foam
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 #endif
197 
198 // ************************************************************************* //
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
Simple container to keep together refinement specific information.
Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.
Simple container to keep together snap specific information.
void doRefine(const dictionary &refineDict, const refinementParameters &refineParams, const snapParameters &snapParams, const bool prepareForSnapping, const dictionary &motionDict)
Do all the refinement.
Abstract base class for decomposition.
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
ClassName("snappyRefineDriver")
Runtime type information.
Namespace for OpenFOAM.