OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

autoRefineDriver.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::autoRefineDriver
00027 
00028 Description
00029 
00030 SourceFiles
00031     autoRefineDriver.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef autoRefineDriver_H
00036 #define autoRefineDriver_H
00037 
00038 #include "treeBoundBox.H"
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 // Forward declaration of classes
00046 class featureEdgeMesh;
00047 class refinementParameters;
00048 class meshRefinement;
00049 class decompositionMethod;
00050 class fvMeshDistribute;
00051 
00052 /*---------------------------------------------------------------------------*\
00053                            Class autoRefineDriver Declaration
00054 \*---------------------------------------------------------------------------*/
00055 
00056 class autoRefineDriver
00057 {
00058     // Private data
00059 
00060         //- Mesh+surface
00061         meshRefinement& meshRefiner_;
00062 
00063         //- Reference to decomposition method
00064         decompositionMethod& decomposer_;
00065 
00066         //- Reference to mesh distribution engine
00067         fvMeshDistribute& distributor_;
00068 
00069         //- From surface region to patch
00070         const labelList globalToPatch_;
00071 
00072 
00073     // Private Member Functions
00074 
00075         //- Read explicit feature edges
00076         label readFeatureEdges
00077         (
00078             const PtrList<dictionary>& featDicts,
00079             PtrList<featureEdgeMesh>& featureMeshes,
00080             labelList& featureLevel
00081         ) const;
00082 
00083         //- Refine all cells pierced by explicit feature edges
00084         label featureEdgeRefine
00085         (
00086             const refinementParameters& refineParams,
00087             const PtrList<dictionary>& featDicts,
00088             const label maxIter,
00089             const label minRefine
00090         );
00091 
00092         //- Refine all cells interacting with the surface
00093         label surfaceOnlyRefine
00094         (
00095             const refinementParameters& refineParams,
00096             const label maxIter
00097         );
00098 
00099         //- Remove all cells within intersected region
00100         void removeInsideCells
00101         (
00102             const refinementParameters& refineParams,
00103             const label nBufferLayers
00104         );
00105 
00106         //- Remove all cells inside/outside shell
00107         label shellRefine
00108         (
00109             const refinementParameters& refineParams,
00110             const label maxIter
00111         );
00112 
00113         //- Add baffles and remove unreachable cells
00114         void baffleAndSplitMesh
00115         (
00116             const refinementParameters& refineParams,
00117             const bool handleSnapProblems,
00118             const dictionary& motionDict
00119         );
00120 
00121         //- Add zones
00122         void zonify(const refinementParameters& refineParams);
00123 
00124         void splitAndMergeBaffles
00125         (
00126             const refinementParameters& refineParams,
00127             const bool handleSnapProblems,
00128             const dictionary& motionDict
00129         );
00130 
00131         //- Merge refined boundary faces (from exposing coarser cell)
00132         void mergePatchFaces
00133         (
00134             const refinementParameters& refineParams
00135         );
00136 
00137 
00138         //- Disallow default bitwise copy construct
00139         autoRefineDriver(const autoRefineDriver&);
00140 
00141         //- Disallow default bitwise assignment
00142         void operator=(const autoRefineDriver&);
00143 
00144 
00145 public:
00146 
00147     //- Runtime type information
00148     ClassName("autoRefineDriver");
00149 
00150 
00151     // Constructors
00152 
00153         //- Construct from components
00154         autoRefineDriver
00155         (
00156             meshRefinement& meshRefiner,
00157             decompositionMethod& decomposer,
00158             fvMeshDistribute& distributor,
00159             const labelList& globalToPatch
00160         );
00161 
00162 
00163     // Member Functions
00164 
00165         //- Do all the refinement
00166         void doRefine
00167         (
00168             const dictionary& refineDict,
00169             const refinementParameters& refineParams,
00170             const bool prepareForSnapping,
00171             const dictionary& motionDict
00172         );
00173 };
00174 
00175 
00176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00177 
00178 } // End namespace Foam
00179 
00180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00181 
00182 #endif
00183 
00184 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd