1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 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::refinementIterator
29 Utility class to do iterating meshCutter until all requests satisfied.
31 Needed since cell cutting can only cut cell once in one go so if
32 refinement pattern is not compatible on a cell by cell basis it will
35 Parallel: communicates. All decisions done on 'reduce'd variable.
40 \*---------------------------------------------------------------------------*/
42 #ifndef refinementIterator_H
43 #define refinementIterator_H
45 #include "edgeVertex.H"
46 #include "labelList.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 // Forward declaration of classes
59 class undoableMeshCutter;
62 /*---------------------------------------------------------------------------*\
63 Class refinementIterator Declaration
64 \*---------------------------------------------------------------------------*/
66 class refinementIterator
75 //- Reference to refinementEngine
76 undoableMeshCutter& meshRefiner_;
78 //- Reference to object to walk individual cells
79 const cellLooper& cellWalker_;
81 //- Whether to write intermediate meshes
87 //- Runtime type information
88 ClassName("refinementIterator");
93 //- Construct from mesh, refinementEngine and cell walking routine.
94 // If writeMesh = true increments runTime and writes intermediate
99 undoableMeshCutter& meshRefiner,
100 const cellLooper& cellWalker,
101 const bool writeMesh = false
107 ~refinementIterator();
112 //- Try to refine cells in given direction. Constructs intermediate
113 // meshes. Returns map from old to added cells.
114 Map<label> setRefinement(const List<refineCell>&);
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 } // End namespace Foam
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 // ************************************************************************* //