FreeFOAM The Cross-Platform CFD Toolkit
autoRefineDriver.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) 1991-2010 OpenCFD Ltd.
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::autoRefineDriver
26 
27 Description
28 
29 SourceFiles
30  autoRefineDriver.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef autoRefineDriver_H
35 #define autoRefineDriver_H
36 
37 #include <meshTools/treeBoundBox.H>
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43 
44 // Forward declaration of classes
45 class featureEdgeMesh;
46 class refinementParameters;
47 class meshRefinement;
48 class decompositionMethod;
49 class fvMeshDistribute;
50 
51 /*---------------------------------------------------------------------------*\
52  Class autoRefineDriver Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 {
57  // Private data
58 
59  //- Mesh+surface
60  meshRefinement& meshRefiner_;
61 
62  //- Reference to decomposition method
63  decompositionMethod& decomposer_;
64 
65  //- Reference to mesh distribution engine
66  fvMeshDistribute& distributor_;
67 
68  //- From surface region to patch
69  const labelList globalToPatch_;
70 
71 
72  // Private Member Functions
73 
74  //- Read explicit feature edges
75  label readFeatureEdges
76  (
77  const PtrList<dictionary>& featDicts,
78  PtrList<featureEdgeMesh>& featureMeshes,
79  labelList& featureLevel
80  ) const;
81 
82  //- Refine all cells pierced by explicit feature edges
83  label featureEdgeRefine
84  (
85  const refinementParameters& refineParams,
86  const PtrList<dictionary>& featDicts,
87  const label maxIter,
88  const label minRefine
89  );
90 
91  //- Refine all cells interacting with the surface
92  label surfaceOnlyRefine
93  (
94  const refinementParameters& refineParams,
95  const label maxIter
96  );
97 
98  //- Remove all cells within intersected region
99  void removeInsideCells
100  (
101  const refinementParameters& refineParams,
102  const label nBufferLayers
103  );
104 
105  //- Remove all cells inside/outside shell
106  label shellRefine
107  (
108  const refinementParameters& refineParams,
109  const label maxIter
110  );
111 
112  //- Add baffles and remove unreachable cells
113  void baffleAndSplitMesh
114  (
115  const refinementParameters& refineParams,
116  const bool handleSnapProblems,
117  const dictionary& motionDict
118  );
119 
120  //- Add zones
121  void zonify(const refinementParameters& refineParams);
122 
123  void splitAndMergeBaffles
124  (
125  const refinementParameters& refineParams,
126  const bool handleSnapProblems,
127  const dictionary& motionDict
128  );
129 
130  //- Merge refined boundary faces (from exposing coarser cell)
131  void mergePatchFaces
132  (
133  const refinementParameters& refineParams
134  );
135 
136 
137  //- Disallow default bitwise copy construct
139 
140  //- Disallow default bitwise assignment
141  void operator=(const autoRefineDriver&);
142 
143 
144 public:
145 
146  //- Runtime type information
147  ClassName("autoRefineDriver");
148 
149 
150  // Constructors
151 
152  //- Construct from components
154  (
155  meshRefinement& meshRefiner,
156  decompositionMethod& decomposer,
157  fvMeshDistribute& distributor,
158  const labelList& globalToPatch
159  );
160 
161 
162  // Member Functions
163 
164  //- Do all the refinement
165  void doRefine
166  (
167  const dictionary& refineDict,
168  const refinementParameters& refineParams,
169  const bool prepareForSnapping,
170  const dictionary& motionDict
171  );
172 };
173 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #endif
182 
183 // ************************ vim: set sw=4 sts=4 et: ************************ //