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