FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::autoRefineDriver
00026 
00027 Description
00028 
00029 SourceFiles
00030     autoRefineDriver.C
00031 
00032 \*---------------------------------------------------------------------------*/
00033 
00034 #ifndef autoRefineDriver_H
00035 #define autoRefineDriver_H
00036 
00037 #include <meshTools/treeBoundBox.H>
00038 
00039 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00040 
00041 namespace Foam
00042 {
00043 
00044 // Forward declaration of classes
00045 class featureEdgeMesh;
00046 class refinementParameters;
00047 class meshRefinement;
00048 class decompositionMethod;
00049 class fvMeshDistribute;
00050 
00051 /*---------------------------------------------------------------------------*\
00052                            Class autoRefineDriver Declaration
00053 \*---------------------------------------------------------------------------*/
00054 
00055 class autoRefineDriver
00056 {
00057     // Private data
00058 
00059         //- Mesh+surface
00060         meshRefinement& meshRefiner_;
00061 
00062         //- Reference to decomposition method
00063         decompositionMethod& decomposer_;
00064 
00065         //- Reference to mesh distribution engine
00066         fvMeshDistribute& distributor_;
00067 
00068         //- From surface region to patch
00069         const labelList globalToPatch_;
00070 
00071 
00072     // Private Member Functions
00073 
00074         //- Read explicit feature edges
00075         label readFeatureEdges
00076         (
00077             const PtrList<dictionary>& featDicts,
00078             PtrList<featureEdgeMesh>& featureMeshes,
00079             labelList& featureLevel
00080         ) const;
00081 
00082         //- Refine all cells pierced by explicit feature edges
00083         label featureEdgeRefine
00084         (
00085             const refinementParameters& refineParams,
00086             const PtrList<dictionary>& featDicts,
00087             const label maxIter,
00088             const label minRefine
00089         );
00090 
00091         //- Refine all cells interacting with the surface
00092         label surfaceOnlyRefine
00093         (
00094             const refinementParameters& refineParams,
00095             const label maxIter
00096         );
00097 
00098         //- Remove all cells within intersected region
00099         void removeInsideCells
00100         (
00101             const refinementParameters& refineParams,
00102             const label nBufferLayers
00103         );
00104 
00105         //- Remove all cells inside/outside shell
00106         label shellRefine
00107         (
00108             const refinementParameters& refineParams,
00109             const label maxIter
00110         );
00111 
00112         //- Add baffles and remove unreachable cells
00113         void baffleAndSplitMesh
00114         (
00115             const refinementParameters& refineParams,
00116             const bool handleSnapProblems,
00117             const dictionary& motionDict
00118         );
00119 
00120         //- Add zones
00121         void zonify(const refinementParameters& refineParams);
00122 
00123         void splitAndMergeBaffles
00124         (
00125             const refinementParameters& refineParams,
00126             const bool handleSnapProblems,
00127             const dictionary& motionDict
00128         );
00129 
00130         //- Merge refined boundary faces (from exposing coarser cell)
00131         void mergePatchFaces
00132         (
00133             const refinementParameters& refineParams
00134         );
00135 
00136 
00137         //- Disallow default bitwise copy construct
00138         autoRefineDriver(const autoRefineDriver&);
00139 
00140         //- Disallow default bitwise assignment
00141         void operator=(const autoRefineDriver&);
00142 
00143 
00144 public:
00145 
00146     //- Runtime type information
00147     ClassName("autoRefineDriver");
00148 
00149 
00150     // Constructors
00151 
00152         //- Construct from components
00153         autoRefineDriver
00154         (
00155             meshRefinement& meshRefiner,
00156             decompositionMethod& decomposer,
00157             fvMeshDistribute& distributor,
00158             const labelList& globalToPatch
00159         );
00160 
00161 
00162     // Member Functions
00163 
00164         //- Do all the refinement
00165         void doRefine
00166         (
00167             const dictionary& refineDict,
00168             const refinementParameters& refineParams,
00169             const bool prepareForSnapping,
00170             const dictionary& motionDict
00171         );
00172 };
00173 
00174 
00175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00176 
00177 } // End namespace Foam
00178 
00179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00180 
00181 #endif
00182 
00183 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines