normal_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::normal
26 
27 Description
28  A zoneGenerator which selects the faces returned by the given
29  zoneGenerator that are aligned with the given normal.
30 
31  The returned faceZone is oriented and provides the corresponding flipMap.
32 
33 Usage
34  \table
35  Property | Description | Required | Default value
36  type | Type: face | yes |
37  name | Name of the zone | no | zoneGenerator name
38  normal | Reference unit vector | yes |
39  tol | cos angle tolerance | yes |
40  moveUpdate | Switch to update after mesh motion | no | false
41  \endtable
42 
43  To create the faceZone \c floatingObjectBottom containing the faces of the
44  \c floatingObject patch which point in the y-direction:
45  \verbatim
46  floatingObjectBottom
47  {
48  type normal;
49 
50  normal (0 1 0);
51  tol 0.01;
52 
53  floatingObject
54  {
55  type patch;
56  patch floatingObject;
57  }
58  }
59  \endverbatim
60 
61 SourceFiles
62  normal_zoneGenerator.C
63 
64 \*---------------------------------------------------------------------------*/
65 
66 #ifndef normal_zoneGenerator_H
67 #define normal_zoneGenerator_H
68 
69 #include "zoneGeneratorList.H"
70 
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73 namespace Foam
74 {
75 namespace zoneGenerators
76 {
77 
78 /*---------------------------------------------------------------------------*\
79  Class normal Declaration
80 \*---------------------------------------------------------------------------*/
81 
82 class normal
83 :
84  public zoneGenerator
85 {
86  // Private Data
87 
88  //- Zone generator supplying the faces
89  autoPtr<zoneGenerator> zoneGenerator_;
90 
91  //- Reference unit vector face orientations are compared to
92  vector normal_;
93 
94  //- Direction comparison tolerance
95  // cos of angle between normal_ and face normal
96  const scalar tol_;
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("normal");
103 
104 
105  // Constructors
106 
107  //- Construct from dictionary
108  normal
109  (
110  const word& name,
111  const polyMesh& mesh,
112  const dictionary& dict
113  );
114 
115 
116  //- Destructor
117  virtual ~normal();
118 
119 
120  // Member Functions
121 
122  virtual zoneSet generate() const;
123 };
124 
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 } // End namespace zoneGenerators
129 } // End namespace Foam
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #endif
134 
135 // ************************************************************************* //
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
const word & name() const
virtual zoneSet generate() const
Generate and return the zoneSet.
TypeName("normal")
Runtime type information.
normal(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
Zone container returned by zoneGenerator::generate.
Definition: zoneSet.H:94
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
Namespace for OpenFOAM.
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
dictionary dict