initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / autoMesh / autoHexMesh / autoHexMeshDriver / autoRefineDriver.H
blob8aa33855def83c7c8cade6f4fa9abbaf202b0ba5
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 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 "meshRefinement.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 namespace Foam
45 // Forward declaration of classes
46 class featureEdgeMesh;
47 class refinementParameters;
50 /*---------------------------------------------------------------------------*\
51                            Class autoRefineDriver Declaration
52 \*---------------------------------------------------------------------------*/
54 class autoRefineDriver
56     // Private data
58         //- Mesh+surface
59         meshRefinement& meshRefiner_;
61         //- Reference to decomposition method
62         decompositionMethod& decomposer_;
64         //- Reference to mesh distribution engine
65         fvMeshDistribute& distributor_;
67         //- From surface region to patch
68         const labelList globalToPatch_;
71     // Private Member Functions
73         //- Read explicit feature edges
74         label readFeatureEdges
75         (
76             const PtrList<dictionary>& featDicts,
77             PtrList<featureEdgeMesh>& featureMeshes,
78             labelList& featureLevel
79         ) const;
81         //- Refine all cells pierced by explicit feature edges
82         label featureEdgeRefine
83         (
84             const refinementParameters& refineParams,
85             const PtrList<dictionary>& featDicts,
86             const label maxIter,
87             const label minRefine
88         );
90         //- Refine all cells interacting with the surface
91         label surfaceOnlyRefine
92         (
93             const refinementParameters& refineParams,
94             const label maxIter
95         );
97         //- Remove all cells within intersected region
98         void removeInsideCells
99         (
100             const refinementParameters& refineParams,
101             const label nBufferLayers
102         );
104         //- Remove all cells inside/outside shell
105         label shellRefine
106         (
107             const refinementParameters& refineParams,
108             const label maxIter
109         );
111         //- Add baffles and remove unreachable cells
112         void baffleAndSplitMesh
113         (
114             const refinementParameters& refineParams,
115             const bool handleSnapProblems
116         );
118         //- Add zones
119         void zonify(const refinementParameters& refineParams);
121         void splitAndMergeBaffles
122         (
123             const refinementParameters& refineParams,
124             const bool handleSnapProblems
125         );
127         //- Merge refined boundary faces (from exposing coarser cell)
128         void mergePatchFaces
129         (
130             const refinementParameters& refineParams
131         );
134         //- Disallow default bitwise copy construct
135         autoRefineDriver(const autoRefineDriver&);
137         //- Disallow default bitwise assignment
138         void operator=(const autoRefineDriver&);
141 public:
143     //- Runtime type information
144     ClassName("autoRefineDriver");
147     // Constructors
149         //- Construct from components
150         autoRefineDriver
151         (
152             meshRefinement& meshRefiner,
153             decompositionMethod& decomposer,
154             fvMeshDistribute& distributor,
155             const labelList& globalToPatch
156         );
159     // Member Functions
161         //- Do all the refinement
162         void doRefine
163         (
164             const dictionary& refineDict,
165             const refinementParameters& refineParams,
166             const bool prepareForSnapping
167         );
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 } // End namespace Foam
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 #endif
179 // ************************************************************************* //