nearPatchCells_zoneGenerator.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) 2025 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::zoneGenerators::nearPatchCells
26 
27 Description
28  A zoneGenerator which constructs a cellZone of the cells within a distance
29  from a set of patches
30 
31 Usage
32  \table
33  Property | Description | Required | Default value
34  type | Type: nearPatchCells | yes |
35  name | Name of the zone | no | zoneGenerator name
36  patch | Name of patch | no |
37  patches | List of patch names | no | ()
38  distance | Distance from the patch | yes |
39  moveUpdate | Switch to update after mesh motion | no | false
40  \endtable
41 
42  To select all cells within one centimetre of a patch named \c walls:
43  \verbatim
44  nearToWalls
45  {
46  type nearPatchCells;
47  patch walls;
48  distance 1 [cm];
49  }
50  \endverbatim
51 
52 SourceFiles
53  nearPatchCells_zoneGenerator.C
54 
55 \*---------------------------------------------------------------------------*/
56 
57 #ifndef nearPatchCells_zoneGenerator_H
58 #define nearPatchCells_zoneGenerator_H
59 
60 #include "zoneGeneratorList.H"
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 namespace zoneGenerators
67 {
68 
69 /*---------------------------------------------------------------------------*\
70  Class nearPatchCells Declaration
71 \*---------------------------------------------------------------------------*/
72 
73 class nearPatchCells
74 :
75  public zoneGenerator
76 {
77  // Private Data
78 
79  //- Set of patches
80  labelHashSet patchSet_;
81 
82  //- Distance from the patch to include in the zone
83  scalar distance_;
84 
85 
86 public:
87 
88  //- Runtime type information
89  TypeName("nearPatchCells");
90 
91 
92  // Constructors
93 
94  //- Construct from dictionary
96  (
97  const word& name,
98  const polyMesh& mesh,
99  const dictionary& dict
100  );
101 
102 
103  //- Destructor
104  virtual ~nearPatchCells();
105 
106 
107  // Member Functions
108 
109  //- Generate and return the zoneSet
110  virtual zoneSet generate() const;
111 };
112 
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 } // End namespace zoneGenerators
117 } // End namespace Foam
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 #endif
122 
123 // ************************************************************************* //
const word & name() const
Return the zoneGenerator name.
const polyMesh & mesh() const
Return reference to the polyMesh.
TypeName("nearPatchCells")
Runtime type information.
virtual zoneSet generate() const
Generate and return the zoneSet.
nearPatchCells(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
Zone container returned by zoneGenerator::generate.
Definition: zoneSet.H:94
Namespace for OpenFOAM.
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
Definition: HashSet.H:213
dictionary dict