orient_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::orient
26 
27 Description
28  A zoneGenerator which sets the face orientation flipMap
29 
30  based either on the face normal alignment with the given normal or
31  orientation with respect to a given point outside the surface.
32 
33  The returned faceZone is oriented and provides the corresponding flipMap.
34 
35 Usage
36  \table
37  Property | Description | Required | Default value
38  type | Type: face | yes |
39  name | Name of the zone | no | zoneGenerator name
40  normal | Reference unit vector | no |
41  outsidePoint | Point outside the surface | no |
42  moveUpdate | Switch to update after mesh motion | no | false
43  \endtable
44 
45  To orient the faceZone \c cut corresponding to the positive y-direction:
46  \verbatim
47  orientedCut
48  {
49  type orient;
50  normal (0 1 0);
51  cut;
52  }
53  \endverbatim
54 
55  To orient the faceZone \c cut with respect to the point (0 100 0) outside
56  the surface:
57  \verbatim
58  orientedCut
59  {
60  type orient;
61  point (0 100 0);
62  cut;
63  }
64  \endverbatim
65 
66 SourceFiles
67  orient_zoneGenerator.C
68 
69 \*---------------------------------------------------------------------------*/
70 
71 #ifndef orient_zoneGenerator_H
72 #define orient_zoneGenerator_H
73 
74 #include "zoneGeneratorList.H"
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 namespace Foam
79 {
80 namespace zoneGenerators
81 {
82 
83 /*---------------------------------------------------------------------------*\
84  Class orient Declaration
85 \*---------------------------------------------------------------------------*/
86 
87 class orient
88 :
89  public zoneGenerator
90 {
91  // Private Data
92 
93  //- Zone generator supplying the faces
94  autoPtr<zoneGenerator> zoneGenerator_;
95 
96  //- Reference unit vector face orientations are compared to
97  vector normal_;
98 
99  //- Seed outside point
100  vector outsidePoint_;
101 
102 
103  // Private Member Functions
104 
105  //- Orientation based on the face normal alignment with the given normal
106  boolList normalOrientation(const labelList& faceIndices) const;
107 
108  //- Orientation based on the given outside point
109  boolList pointOrientation(const faceZone& fZone) const;
110 
111  //- Select orientation algorithm based on the user inputs
112  boolList orientation(const faceZone& fZone) const;
113 
114 
115 public:
116 
117  //- Runtime type information
118  TypeName("orient");
119 
120 
121  // Constructors
122 
123  //- Construct from dictionary
124  orient
125  (
126  const word& name,
127  const polyMesh& mesh,
128  const dictionary& dict
129  );
130 
131 
132  //- Destructor
133  virtual ~orient();
134 
135 
136  // Member Functions
137 
138  virtual zoneSet generate() const;
139 };
140 
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 } // End namespace zoneGenerators
145 } // End namespace Foam
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 #endif
150 
151 // ************************************************************************* //
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
A class for handling words, derived from string.
Definition: word.H:62
const word & name() const
virtual zoneSet generate() const
Generate and return the zoneSet.
TypeName("orient")
Runtime type information.
orient(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.
List< label > labelList
A List of labels.
Definition: labelList.H:56
List< bool > boolList
Bool container classes.
Definition: boolList.H:50
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
dictionary dict