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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::refinementIterator
29
30Description
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
39SourceFiles
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
55namespace Foam
56{
57
58// Forward Declarations
59class polyMesh;
60class refineCell;
61class undoableMeshCutter;
62class cellLooper;
63
64/*---------------------------------------------------------------------------*\
65 Class refinementIterator Declaration
66\*---------------------------------------------------------------------------*/
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
87public:
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// ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
A HashTable to objects of type <T> with a label key.
Definition: Map.H:60
Abstract base class. Concrete implementations know how to cut a cell (i.e. determine a loop around th...
Definition: cellLooper.H:75
Combines edge or vertex in single label. Used to specify cuts across cell circumference.
Definition: edgeVertex.H:56
const polyMesh & mesh() const
Definition: edgeVertex.H:101
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Utility class to do iterating meshCutter until all requests satisfied.
ClassName("refinementIterator")
Runtime type information.
Map< label > setRefinement(const List< refineCell > &)
Try to refine cells in given direction. Constructs intermediate.
The main refinement handler. Gets cellCuts which is structure that describes which cells are to be cu...
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition: className.H:67
Namespace for OpenFOAM.