1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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
26 Foam::autoRefineDriver
33 \*---------------------------------------------------------------------------*/
35 #ifndef autoRefineDriver_H
36 #define autoRefineDriver_H
38 #include "meshRefinement.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 // Forward declaration of classes
46 class featureEdgeMesh;
47 class refinementParameters;
50 /*---------------------------------------------------------------------------*\
51 Class autoRefineDriver Declaration
52 \*---------------------------------------------------------------------------*/
54 class autoRefineDriver
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
76 const PtrList<dictionary>& featDicts,
77 PtrList<featureEdgeMesh>& featureMeshes,
78 labelList& featureLevel
81 //- Refine all cells pierced by explicit feature edges
82 label featureEdgeRefine
84 const refinementParameters& refineParams,
85 const PtrList<dictionary>& featDicts,
90 //- Refine all cells interacting with the surface
91 label surfaceOnlyRefine
93 const refinementParameters& refineParams,
97 //- Remove all cells within intersected region
98 void removeInsideCells
100 const refinementParameters& refineParams,
101 const label nBufferLayers
104 //- Remove all cells inside/outside shell
107 const refinementParameters& refineParams,
111 //- Add baffles and remove unreachable cells
112 void baffleAndSplitMesh
114 const refinementParameters& refineParams,
115 const bool handleSnapProblems
119 void zonify(const refinementParameters& refineParams);
121 void splitAndMergeBaffles
123 const refinementParameters& refineParams,
124 const bool handleSnapProblems
127 //- Merge refined boundary faces (from exposing coarser cell)
130 const refinementParameters& refineParams
134 //- Disallow default bitwise copy construct
135 autoRefineDriver(const autoRefineDriver&);
137 //- Disallow default bitwise assignment
138 void operator=(const autoRefineDriver&);
143 //- Runtime type information
144 ClassName("autoRefineDriver");
149 //- Construct from components
152 meshRefinement& meshRefiner,
153 decompositionMethod& decomposer,
154 fvMeshDistribute& distributor,
155 const labelList& globalToPatch
161 //- Do all the refinement
164 const dictionary& refineDict,
165 const refinementParameters& refineParams,
166 const bool prepareForSnapping
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 } // End namespace Foam
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 // ************************************************************************* //