initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / dynamicMesh / meshCut / meshModifiers / refinementIterator / refinementIterator.H
blob381ffe0454f4141bc22053773a600912a6575783
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::refinementIterator
28 Description
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
33     refuse to cut.
35     Parallel: communicates. All decisions done on 'reduce'd variable.
37 SourceFiles
38     refinementIterator.C
40 \*---------------------------------------------------------------------------*/
42 #ifndef refinementIterator_H
43 #define refinementIterator_H
45 #include "edgeVertex.H"
46 #include "labelList.H"
47 #include "Map.H"
48 #include "typeInfo.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 namespace Foam
56 // Forward declaration of classes
57 class polyMesh;
58 class refineCell;
59 class undoableMeshCutter;
60 class cellLooper;
62 /*---------------------------------------------------------------------------*\
63                            Class refinementIterator Declaration
64 \*---------------------------------------------------------------------------*/
66 class refinementIterator
68     public edgeVertex
70     // Private data
72         //- Reference to mesh
73         polyMesh& mesh_;
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
82         bool writeMesh_;
85 public:
87     //- Runtime type information
88     ClassName("refinementIterator");
91     // Constructors
93         //- Construct from mesh, refinementEngine and cell walking routine.
94         //  If writeMesh = true increments runTime and writes intermediate
95         //  meshes.
96         refinementIterator
97         (
98             polyMesh& mesh,
99             undoableMeshCutter& meshRefiner,
100             const cellLooper& cellWalker,
101             const bool writeMesh = false
102         );
105     // Destructor
107         ~refinementIterator();
110     // Member Functions
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 #endif
127 // ************************************************************************* //