removeCells.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-2021 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::removeCells
26 
27 Description
28  Given list of cells to remove insert all the topology changes.
29 
30  Works in two passes:
31  - get faces that will become boundary faces
32  - given these faces and the patches they have to go into make the
33  changes.
34 
35 SourceFiles
36  removeCells.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef removeCells_H
41 #define removeCells_H
42 
43 #include "labelList.H"
44 #include "typeInfo.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 // Forward declaration of classes
52 class polyMesh;
53 class polyTopoChange;
54 class mapPolyMesh;
55 
56 /*---------------------------------------------------------------------------*\
57  Class removeCells Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 class removeCells
61 {
62  // Private Data
63 
64  //- Reference to mesh
65  const polyMesh& mesh_;
66 
67  //- Whether or not to synchronise parallel case.
68  const bool syncPar_;
69 
70 
71  // Private Member Functions
72 
73  //- Decrease count of elements of f
74  static void uncount
75  (
76  const labelList& f,
77  labelList& nUsage
78  );
79 
80 
81 public:
82 
83  //- Runtime type information
84  ClassName("removeCells");
85 
86 
87  // Constructors
88 
89  //- Construct from mesh. syncPar: do parallel synchronisation.
90  removeCells(const polyMesh& mesh, const bool syncPar = true);
91 
92 
93  // Member Functions
94 
95  // Topology changes
96 
97  //- Get labels of exposed faces.
98  // These are
99  // - internal faces that become boundary faces
100  // - coupled faces that become uncoupled (since one of the sides
101  // gets deleted)
102  labelList getExposedFaces(const labelList& cellsToRemove) const;
103 
104  //- Play commands into polyTopoChange to remove cells.
105  // patchIDs is for every element in facesToExpose (see above) the
106  // patch it has to go into. This cannot be a coupled patch!
107  void setRefinement
108  (
109  const labelList& cellsToRemove,
110  const labelList& facesToExpose,
111  const labelList& patchIDs,
113  ) const;
114 
115  //- Force recalculation of locally stored data on topological change
116  void updateMesh(const mapPolyMesh&)
117  {}
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 #endif
128 
129 // ************************************************************************* //
void setRefinement(const labelList &cellsToRemove, const labelList &facesToExpose, const labelList &patchIDs, polyTopoChange &) const
Play commands into polyTopoChange to remove cells.
Definition: removeCells.C:179
Given list of cells to remove insert all the topology changes.
Definition: removeCells.H:59
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
dynamicFvMesh & mesh
ClassName("removeCells")
Runtime type information.
void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
Definition: removeCells.H:115
removeCells(const polyMesh &mesh, const bool syncPar=true)
Construct from mesh. syncPar: do parallel synchronisation.
Definition: removeCells.C:60
labelList f(nPoints)
Direct mesh changes based on v1.3 polyTopoChange syntax.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
labelList getExposedFaces(const labelList &cellsToRemove) const
Get labels of exposed faces.
Definition: removeCells.C:73
Namespace for OpenFOAM.