FreeFOAM The Cross-Platform CFD Toolkit
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) 1991-2010 OpenCFD Ltd.
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 <OpenFOAM/labelList.H>
44 #include <OpenFOAM/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 
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. These are
98  // - internal faces that become boundary faces
99  // - coupled faces that become uncoupled (since one of the sides
100  // gets deleted)
101  labelList getExposedFaces(const labelList& cellsToRemove) const;
102 
103  //- Play commands into polyTopoChange to remove cells.
104  // patchIDs is for every element in facesToExpose (see above) the
105  // patch it has to go into. This cannot be a coupled patch!
106  void setRefinement
107  (
108  const labelList& cellsToRemove,
109  const labelList& facesToExpose,
110  const labelList& patchIDs,
112  ) const;
113 
114  //- Force recalculation of locally stored data on topological change
115  void updateMesh(const mapPolyMesh&)
116  {}
117 
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 #endif
128 
129 // ************************ vim: set sw=4 sts=4 et: ************************ //