1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
25 Foam::refinementIterator
28 Utility class to do iterating meshCutter until all requests satisfied.
30 Needed since cell cutting can only cut cell once in one go so if
31 refinement pattern is not compatible on a cell by cell basis it will
34 Parallel: communicates. All decisions done on 'reduce'd variable.
39 \*---------------------------------------------------------------------------*/
41 #ifndef refinementIterator_H
42 #define refinementIterator_H
44 #include "edgeVertex.H"
45 #include "labelList.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 // Forward declaration of classes
58 class undoableMeshCutter;
61 /*---------------------------------------------------------------------------*\
62 Class refinementIterator Declaration
63 \*---------------------------------------------------------------------------*/
65 class refinementIterator
74 //- Reference to refinementEngine
75 undoableMeshCutter& meshRefiner_;
77 //- Reference to object to walk individual cells
78 const cellLooper& cellWalker_;
80 //- Whether to write intermediate meshes
86 //- Runtime type information
87 ClassName("refinementIterator");
92 //- Construct from mesh, refinementEngine and cell walking routine.
93 // If writeMesh = true increments runTime and writes intermediate
98 undoableMeshCutter& meshRefiner,
99 const cellLooper& cellWalker,
100 const bool writeMesh = false
105 ~refinementIterator();
110 //- Try to refine cells in given direction. Constructs intermediate
111 // meshes. Returns map from old to added cells.
112 Map<label> setRefinement(const List<refineCell>&);
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 } // End namespace Foam
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 // ************************************************************************* //