removeCells.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) 2018 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::removeCells
29 
30 Description
31  Given list of cells to remove, insert all the topology changes.
32 
33  Works in two passes:
34  - get faces that will become boundary faces
35  - given these faces and the patches they have to go into make the
36  changes.
37 
38 SourceFiles
39  removeCells.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef removeCells_H
44 #define removeCells_H
45 
46 #include "labelList.H"
47 #include "typeInfo.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 // Forward Declarations
55 class bitSet;
56 class polyMesh;
57 class polyTopoChange;
58 class mapPolyMesh;
59 
60 /*---------------------------------------------------------------------------*\
61  Class removeCells Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 class removeCells
65 {
66  // Private data
67 
68  //- Reference to mesh
69  const polyMesh& mesh_;
70 
71  //- Whether or not to synchronize parallel case.
72  const bool syncPar_;
73 
74 public:
75 
76  //- Runtime type information
77  ClassName("removeCells");
78 
79 
80  // Constructors
81 
82  //- Construct from mesh. With parallel synchronization.
83  explicit removeCells(const polyMesh& mesh);
84 
85  //- Construct from mesh, optionally with parallel synchronization.
86  removeCells(const polyMesh& mesh, const bool syncPar);
87 
88 
89  //- Destructor
90  ~removeCells() = default;
91 
92 
93  // Member Functions
94 
95  //- Get labels of faces exposed after cells removal.
96  // These are
97  // - internal faces that become boundary faces
98  // - coupled faces that become uncoupled (since one of the sides
99  // gets deleted)
100  labelList getExposedFaces(const bitSet& removedCell) const;
101 
102  //- Get labels of faces exposed after cells removal.
103  // These are
104  // - internal faces that become boundary faces
105  // - coupled faces that become uncoupled (since one of the sides
106  // gets deleted)
107  labelList getExposedFaces(const labelUList& cellsToRemove) const;
108 
109  //- Play commands into polyTopoChange to remove cells.
110  // patchIDs is for every element in facesToExpose (see above) the
111  // patch it has to go into. This cannot be a coupled patch!
112  void setRefinement
113  (
114  const bitSet& removedCell,
115  const labelUList& facesToExpose,
116  const labelUList& patchIDs,
118  ) const;
119 
120  //- Play commands into polyTopoChange to remove cells.
121  // patchIDs is for every element in facesToExpose (see above) the
122  // patch it has to go into. This cannot be a coupled patch!
123  void setRefinement
124  (
125  const labelUList& cellsToRemove,
126  const labelUList& facesToExpose,
127  const labelUList& patchIDs,
129  ) const;
130 
131  //- Force recalculation of locally stored data on topological change
132  void updateMesh(const mapPolyMesh&)
133  {}
134 };
135 
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 } // End namespace Foam
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 #endif
144 
145 // ************************************************************************* //
Foam::bitSet
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:64
typeInfo.H
Foam::removeCells
Given list of cells to remove, insert all the topology changes.
Definition: removeCells.H:63
Foam::polyTopoChange
Direct mesh changes based on v1.3 polyTopoChange syntax.
Definition: polyTopoChange.H:99
Foam::removeCells::updateMesh
void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
Definition: removeCells.H:131
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::removeCells::setRefinement
void setRefinement(const bitSet &removedCell, const labelUList &facesToExpose, const labelUList &patchIDs, polyTopoChange &) const
Play commands into polyTopoChange to remove cells.
Definition: removeCells.C:201
labelList.H
Foam::removeCells::ClassName
ClassName("removeCells")
Runtime type information.
Foam::removeCells::removeCells
removeCells(const polyMesh &mesh)
Construct from mesh. With parallel synchronization.
Definition: removeCells.C:75
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::removeCells::~removeCells
~removeCells()=default
Destructor.
Foam::List< label >
Foam::UList< label >
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:160
Foam::removeCells::getExposedFaces
labelList getExposedFaces(const bitSet &removedCell) const
Get labels of faces exposed after cells removal.
Definition: removeCells.C:97