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 | Copyright (C) 2011 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 synchronize 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 synchronization.
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 // ************************************************************************* //
Foam::removeCells::mesh_
const polyMesh & mesh_
Reference to mesh.
Definition: removeCells.H:64
typeInfo.H
Foam::removeCells
Given list of cells to remove insert all the topology changes.
Definition: removeCells.H:59
Foam::polyTopoChange
Direct mesh changes based on v1.3 polyTopoChange syntax.
Definition: polyTopoChange.H:97
Foam::removeCells::updateMesh
void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
Definition: removeCells.H:115
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
labelList.H
Foam::removeCells::ClassName
ClassName("removeCells")
Runtime type information.
Foam::removeCells::setRefinement
void setRefinement(const labelList &cellsToRemove, const labelList &facesToExpose, const labelList &patchIDs, polyTopoChange &) const
Play commands into polyTopoChange to remove cells.
Definition: removeCells.C:189
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::removeCells::syncPar_
const bool syncPar_
Whether or not to synchronize parallel case.
Definition: removeCells.H:67
f
labelList f(nPoints)
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
Foam::removeCells::removeCells
removeCells(const polyMesh &mesh, const bool syncPar=true)
Construct from mesh. syncPar: do parallel synchronization.
Definition: removeCells.C:60
Foam::removeCells::uncount
static void uncount(const labelList &f, labelList &nUsage)
Decrease count of elements of f.
Definition: removeCells.C:45
Foam::removeCells::getExposedFaces
labelList getExposedFaces(const labelList &cellsToRemove) const
Get labels of exposed faces.
Definition: removeCells.C:73