regionSplit2D.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) 2015-2020 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::regionSplit2D
28 
29 Description
30  Splits a patch into regions based on a mask field. Result is a globally
31  consistent label list of region index per patch face.
32 
33 SourceFiles
34  regionSplit2D.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef regionSplit2D_H
39 #define regionSplit2D_H
40 
41 #include "DynamicList.H"
42 #include "boolList.H"
43 #include "labelList.H"
44 #include "indirectPrimitivePatch.H"
45 #include "globalIndex.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 class faceZone;
53 class polyMesh;
54 
55 /*---------------------------------------------------------------------------*\
56  Class regionSplit2D Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class regionSplit2D
60 :
61  public labelList
62 {
63  // Private data
64 
65  //- Number of regions
66  label nRegions_;
67 
68 
69  // Private Member Functions
70 
71  //- No copy construct
72  regionSplit2D(const regionSplit2D&) = delete;
73 
74  //- No copy assignment
75  void operator=(const regionSplit2D&) = delete;
76 
77 
78 public:
79 
80  // Constructors
81 
82  //- Construct from mesh and list of blocked faces
84  (
85  const polyMesh& mesh,
87  const boolList& blockedFaces,
88  const label offset = 0
89  );
90 
91 
92  //- Destructor
94 
95 
96  // Member Functions
97 
98  //- Return the global number of regions
99  label nRegions() const
100  {
101  return nRegions_;
102  }
103 };
104 
105 
106 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
107 
108 } // End namespace Foam
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 #endif
113 
114 // ************************************************************************* //
boolList.H
Foam::regionSplit2D
Splits a patch into regions based on a mask field. Result is a globally consistent label list of regi...
Definition: regionSplit2D.H:58
Foam::regionSplit2D::~regionSplit2D
~regionSplit2D()
Destructor.
Definition: regionSplit2D.C:154
globalIndex.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::regionSplit2D::nRegions
label nRegions() const
Return the global number of regions.
Definition: regionSplit2D.H:98
labelList.H
indirectPrimitivePatch.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::List< label >
DynamicList.H
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatch.H:85