initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / autoMesh / autoHexMesh / autoHexMeshDriver / autoRefineDriver.H
blob2ad3eb1493a17399f1e3c761c63a6ffdc3e87683
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::autoRefineDriver
28 Description
30 SourceFiles
31     autoRefineDriver.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef autoRefineDriver_H
36 #define autoRefineDriver_H
38 #include "treeBoundBox.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 namespace Foam
45 // Forward declaration of classes
46 class featureEdgeMesh;
47 class refinementParameters;
48 class meshRefinement;
49 class decompositionMethod;
50 class fvMeshDistribute;
52 /*---------------------------------------------------------------------------*\
53                            Class autoRefineDriver Declaration
54 \*---------------------------------------------------------------------------*/
56 class autoRefineDriver
58     // Private data
60         //- Mesh+surface
61         meshRefinement& meshRefiner_;
63         //- Reference to decomposition method
64         decompositionMethod& decomposer_;
66         //- Reference to mesh distribution engine
67         fvMeshDistribute& distributor_;
69         //- From surface region to patch
70         const labelList globalToPatch_;
73     // Private Member Functions
75         //- Read explicit feature edges
76         label readFeatureEdges
77         (
78             const PtrList<dictionary>& featDicts,
79             PtrList<featureEdgeMesh>& featureMeshes,
80             labelList& featureLevel
81         ) const;
83         //- Refine all cells pierced by explicit feature edges
84         label featureEdgeRefine
85         (
86             const refinementParameters& refineParams,
87             const PtrList<dictionary>& featDicts,
88             const label maxIter,
89             const label minRefine
90         );
92         //- Refine all cells interacting with the surface
93         label surfaceOnlyRefine
94         (
95             const refinementParameters& refineParams,
96             const label maxIter
97         );
99         //- Remove all cells within intersected region
100         void removeInsideCells
101         (
102             const refinementParameters& refineParams,
103             const label nBufferLayers
104         );
106         //- Remove all cells inside/outside shell
107         label shellRefine
108         (
109             const refinementParameters& refineParams,
110             const label maxIter
111         );
113         //- Add baffles and remove unreachable cells
114         void baffleAndSplitMesh
115         (
116             const refinementParameters& refineParams,
117             const bool handleSnapProblems,
118             const dictionary& motionDict
119         );
121         //- Add zones
122         void zonify(const refinementParameters& refineParams);
124         void splitAndMergeBaffles
125         (
126             const refinementParameters& refineParams,
127             const bool handleSnapProblems,
128             const dictionary& motionDict
129         );
131         //- Merge refined boundary faces (from exposing coarser cell)
132         void mergePatchFaces
133         (
134             const refinementParameters& refineParams
135         );
138         //- Disallow default bitwise copy construct
139         autoRefineDriver(const autoRefineDriver&);
141         //- Disallow default bitwise assignment
142         void operator=(const autoRefineDriver&);
145 public:
147     //- Runtime type information
148     ClassName("autoRefineDriver");
151     // Constructors
153         //- Construct from components
154         autoRefineDriver
155         (
156             meshRefinement& meshRefiner,
157             decompositionMethod& decomposer,
158             fvMeshDistribute& distributor,
159             const labelList& globalToPatch
160         );
163     // Member Functions
165         //- Do all the refinement
166         void doRefine
167         (
168             const dictionary& refineDict,
169             const refinementParameters& refineParams,
170             const bool prepareForSnapping,
171             const dictionary& motionDict
172         );
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 } // End namespace Foam
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 #endif
184 // ************************************************************************* //