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

refinementIterator.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::refinementIterator
00027 
00028 Description
00029     Utility class to do iterating meshCutter until all requests satisfied.
00030  
00031     Needed since cell cutting can only cut cell once in one go so if
00032     refinement pattern is not compatible on a cell by cell basis it will
00033     refuse to cut.
00034 
00035     Parallel: communicates. All decisions done on 'reduce'd variable.
00036 
00037 SourceFiles
00038     refinementIterator.C
00039 
00040 \*---------------------------------------------------------------------------*/
00041 
00042 #ifndef refinementIterator_H
00043 #define refinementIterator_H
00044 
00045 #include "edgeVertex.H"
00046 #include "labelList.H"
00047 #include "Map.H"
00048 #include "typeInfo.H"
00049 
00050 
00051 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00052 
00053 namespace Foam
00054 {
00055 
00056 // Forward declaration of classes
00057 class polyMesh;
00058 class refineCell;
00059 class undoableMeshCutter;
00060 class cellLooper;
00061 
00062 /*---------------------------------------------------------------------------*\
00063                            Class refinementIterator Declaration
00064 \*---------------------------------------------------------------------------*/
00065 
00066 class refinementIterator
00067 :
00068     public edgeVertex
00069 {
00070     // Private data
00071 
00072         //- Reference to mesh
00073         polyMesh& mesh_;
00074 
00075         //- Reference to refinementEngine
00076         undoableMeshCutter& meshRefiner_;
00077 
00078         //- Reference to object to walk individual cells
00079         const cellLooper& cellWalker_;
00080 
00081         //- Whether to write intermediate meshes
00082         bool writeMesh_;
00083 
00084 
00085 public:
00086 
00087     //- Runtime type information
00088     ClassName("refinementIterator");
00089 
00090 
00091     // Constructors
00092 
00093         //- Construct from mesh, refinementEngine and cell walking routine.
00094         //  If writeMesh = true increments runTime and writes intermediate
00095         //  meshes.
00096         refinementIterator
00097         (
00098             polyMesh& mesh,
00099             undoableMeshCutter& meshRefiner,
00100             const cellLooper& cellWalker,
00101             const bool writeMesh = false
00102         );
00103 
00104 
00105     // Destructor
00106 
00107         ~refinementIterator();
00108 
00109 
00110     // Member Functions
00111 
00112         //- Try to refine cells in given direction. Constructs intermediate
00113         //  meshes. Returns map from old to added cells.
00114         Map<label> setRefinement(const List<refineCell>&);
00115 
00116 };
00117 
00118 
00119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00120 
00121 } // End namespace Foam
00122 
00123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00124 
00125 #endif
00126 
00127 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd