refinementIterator.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Class
25  Foam::refinementIterator
26 
27 Description
28  Utility class to do iterating meshCutter until all requests satisfied.
29 
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
32  refuse to cut.
33 
34  Parallel: communicates. All decisions done on 'reduce'd variable.
35 
36 SourceFiles
37  refinementIterator.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef refinementIterator_H
42 #define refinementIterator_H
43 
44 #include "edgeVertex.H"
45 #include "labelList.H"
46 #include "Map.H"
47 #include "typeInfo.H"
48 
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 // Forward declaration of classes
56 class polyMesh;
57 class refineCell;
58 class undoableMeshCutter;
59 class cellLooper;
60 
61 /*---------------------------------------------------------------------------*\
62  Class refinementIterator Declaration
63 \*---------------------------------------------------------------------------*/
64 
66 :
67  public edgeVertex
68 {
69  // Private Data
70 
71  //- Reference to mesh
72  polyMesh& mesh_;
73 
74  //- Reference to refinementEngine
75  undoableMeshCutter& meshRefiner_;
76 
77  //- Reference to object to walk individual cells
78  const cellLooper& cellWalker_;
79 
80  //- Whether to write intermediate meshes
81  bool writeMesh_;
82 
83 
84 public:
85 
86  //- Runtime type information
87  ClassName("refinementIterator");
88 
89 
90  // Constructors
91 
92  //- Construct from mesh, refinementEngine and cell walking routine.
93  // If writeMesh = true increments runTime and writes intermediate
94  // meshes.
96  (
97  polyMesh& mesh,
98  undoableMeshCutter& meshRefiner,
99  const cellLooper& cellWalker,
100  const bool writeMesh = false
101  );
102 
103 
104  //- Destructor
106 
107 
108  // Member Functions
109 
110  //- Try to refine cells in given direction. Constructs intermediate
111  // meshes. Returns map from old to added cells.
113 
114 };
115 
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 } // End namespace Foam
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 #endif
124 
125 // ************************************************************************* //
Map< label > setRefinement(const List< refineCell > &)
Try to refine cells in given direction. Constructs intermediate.
Abstract base class. Concrete implementations know how to cut a cell (i.e. determine a loop around th...
Definition: cellLooper.H:69
The main refinement handler. Gets cellCuts which is structure that describes which cells are to be cu...
Combines edge or vertex in single label. Used to specify cuts across cell circumference.
Definition: edgeVertex.H:52
const polyMesh & mesh() const
Definition: edgeVertex.H:93
Utility class to do iterating meshCutter until all requests satisfied.
ClassName("refinementIterator")
Runtime type information.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
refinementIterator(polyMesh &mesh, undoableMeshCutter &meshRefiner, const cellLooper &cellWalker, const bool writeMesh=false)
Construct from mesh, refinementEngine and cell walking routine.
Namespace for OpenFOAM.