refinementIterator.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::refinementIterator
29 
30 Description
31  Utility class to do iterating meshCutter until all requests satisfied.
32 
33  Needed since cell cutting can only cut cell once in one go so if
34  refinement pattern is not compatible on a cell by cell basis it will
35  refuse to cut.
36 
37  Parallel: communicates. All decisions done on 'reduce'd variable.
38 
39 SourceFiles
40  refinementIterator.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef refinementIterator_H
45 #define refinementIterator_H
46 
47 #include "edgeVertex.H"
48 #include "labelList.H"
49 #include "Map.H"
50 #include "typeInfo.H"
51 
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 // Forward Declarations
59 class polyMesh;
60 class refineCell;
61 class undoableMeshCutter;
62 class cellLooper;
63 
64 /*---------------------------------------------------------------------------*\
65  Class refinementIterator Declaration
66 \*---------------------------------------------------------------------------*/
67 
69 :
70  public edgeVertex
71 {
72  // Private Data
73 
74  //- Reference to mesh
75  polyMesh& mesh_;
76 
77  //- Reference to refinementEngine
78  undoableMeshCutter& meshRefiner_;
79 
80  //- Reference to object to walk individual cells
81  const cellLooper& cellWalker_;
82 
83  //- Whether to write intermediate meshes
84  bool writeMesh_;
85 
86 
87 public:
88 
89  //- Runtime type information
90  ClassName("refinementIterator");
91 
92 
93  // Constructors
94 
95  //- Construct from mesh, refinementEngine and cell walking routine.
96  // If writeMesh = true increments runTime and writes intermediate
97  // meshes.
99  (
100  polyMesh& mesh,
101  undoableMeshCutter& meshRefiner,
102  const cellLooper& cellWalker,
103  const bool writeMesh = false
104  );
105 
106 
107  //- Destructor
109 
110 
111  // Member Functions
112 
113  //- Try to refine cells in given direction. Constructs intermediate
114  // meshes. Returns map from old to added cells.
116 
117 };
118 
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 } // End namespace Foam
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 #endif
127 
128 // ************************************************************************* //
typeInfo.H
Foam::refinementIterator::setRefinement
Map< label > setRefinement(const List< refineCell > &)
Try to refine cells in given direction. Constructs intermediate.
Definition: refinementIterator.C:75
Foam::refinementIterator
Utility class to do iterating meshCutter until all requests satisfied.
Definition: refinementIterator.H:67
Foam::edgeVertex
Combines edge or vertex in single label. Used to specify cuts across cell circumference.
Definition: edgeVertex.H:55
Foam::Map< label >
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Map.H
Foam::refinementIterator::ClassName
ClassName("refinementIterator")
Runtime type information.
labelList.H
Foam::cellLooper
Abstract base class. Concrete implementations know how to cut a cell (i.e. determine a loop around th...
Definition: cellLooper.H:72
Foam::refinementIterator::~refinementIterator
~refinementIterator()
Destructor.
Definition: refinementIterator.C:68
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::List< refineCell >
Foam::refinementIterator::refinementIterator
refinementIterator(polyMesh &mesh, undoableMeshCutter &meshRefiner, const cellLooper &cellWalker, const bool writeMesh=false)
Construct from mesh, refinementEngine and cell walking routine.
Definition: refinementIterator.C:51
edgeVertex.H
Foam::undoableMeshCutter
The main refinement handler. Gets cellCuts which is structure that describes which cells are to be cu...
Definition: undoableMeshCutter.H:93
Foam::edgeVertex::mesh
const polyMesh & mesh() const
Definition: edgeVertex.H:101