fvMeshSubsetter.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-2017 OpenFOAM Foundation
9  Copyright (C) 2016-2022 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::fvMeshSubsetter
29 
30 Description
31  Extends Foam::fvMeshSubset with two-step subsetting
32  (uses polyTopoChange modification).
33 
34 SourceFiles
35  fvMeshSubsetter.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef Foam_fvMeshSubsetter_H
40 #define Foam_fvMeshSubsetter_H
41 
42 #include "fvMeshSubset.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class fvMeshSubsetter Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class fvMeshSubsetter
54 :
55  public fvMeshSubset
56 {
57  // Private Member Functions
58 
59  //- Forwarding to Foam::removeCells
60  void removeCellsImpl
61  (
62  const bitSet& cellsToRemove,
63  const labelList& exposedFaces,
64  const labelList& patchIDs,
65  const bool syncPar
66  );
67 
68  //- No copy construct
69  fvMeshSubsetter(const fvMeshSubsetter&) = delete;
70 
71  //- No copy assignment
72  void operator=(const fvMeshSubset&) = delete;
73 
74 public:
75 
76  // Constructors
77 
78  //- Inherit constructors from fvMeshSubset
80 
81 
82  // Member Functions
83 
84  //- Inherit all one-step subsetting
86 
87 
88  // Two-step subsetting
89 
90  //- Get labels of exposed faces.
91  // These are
92  // - internal faces that become boundary faces
93  // - coupled faces that become uncoupled (since one of the
94  // sides gets deleted)
96  (
97  const bitSet& selectedCells,
98  const bool syncPar = true
99  ) const;
100 
101  //- Get labels of exposed faces.
102  // These are
103  // - internal faces that become boundary faces
104  // - coupled faces that become uncoupled (since one of the
105  // sides gets deleted)
107  (
108  const label regioni,
109  const labelUList& regions,
110  const bool syncPar = true
111  ) const;
112 
113  //- For every exposed face (from above getExposedFaces)
114  // Uses supplied (existing!) patches
115  void setCellSubset
116  (
117  const bitSet& selectedCells,
118  const labelList& exposedFaces,
119  const labelList& patchIDs,
120  const bool syncPar = true
121  );
122 
123  //- For every exposed face (from above getExposedFaces)
124  // Uses supplied (existing!) patches
125  void setCellSubset
126  (
127  const label regioni,
128  const labelList& regions,
129  const labelList& exposedFaces,
130  const labelList& patchIDs,
131  const bool syncPar = true
132  );
133 };
134 
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 } // End namespace Foam
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
const labelList patchIDs(pbm.indices(polyPatchNames, true))
void setCellSubset(const bitSet &selectedCells, const label patchID=-1, const bool syncPar=true)
Use the specified subset of cells. Same as reset()
Definition: fvMeshSubset.H:374
void setCellSubset(const bitSet &selectedCells, const labelList &exposedFaces, const labelList &patchIDs, const bool syncPar=true)
For every exposed face (from above getExposedFaces)
labelList getExposedFaces(const bitSet &selectedCells, const bool syncPar=true) const
Get labels of exposed faces.
Holds a reference to the original mesh (the baseMesh) and optionally to a subset of that mesh (the su...
Definition: fvMeshSubset.H:75
fvMeshSubset(const fvMeshSubset &)=delete
No copy construct.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:59
Extends Foam::fvMeshSubset with two-step subsetting (uses polyTopoChange modification).
Namespace for OpenFOAM.