setAndNormalToFaceZone.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) 2013 OpenFOAM Foundation
9  Copyright (C) 2018-2020 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::setAndNormalToFaceZone
29 
30 Description
31  A \c topoSetSource to select faces based on usage in a \c faceSet,
32  where the normal vector is used to orient the faces.
33 
34  Operands:
35  \table
36  Operand | Type | Location
37  input | faceSet | $FOAM_CASE/constant/polyMesh/sets/<set>
38  output | faceZone | $FOAM_CASE/constant/polyMesh/faceZones
39  \endtable
40 
41 Usage
42  Minimal example by using \c system/topoSetDict.actions:
43  \verbatim
44  {
45  // Mandatory (inherited) entries
46  name <name>;
47  type faceZoneSet;
48  action <action>;
49 
50  // Mandatory entries
51  source setAndNormalToFaceZone;
52  faceSet <faceSetName>;
53  normal (1 0 0);
54  }
55  \endverbatim
56 
57  where the entries mean:
58  \table
59  Property | Description | Type | Req'd | Dflt
60  name | Name of faceZoneSet | word | yes | -
61  type | Type name: faceZoneSet | word | yes | -
62  action | Action applied on faces - see below | word | yes | -
63  source | Source name: setAndNormalToFaceZone | word | yes | -
64  faceSet | Name of input faceSet | word | yes | -
65  normal | The normal vector for orientation | vector | yes | -
66  \endtable
67 
68  Options for the \c action entry:
69  \verbatim
70  new | Create a new faceZoneSet from selected faces
71  add | Add selected faces into this faceZoneSet
72  subtract | Remove selected faces from this faceZoneSet
73  \endverbatim
74 
75 SourceFiles
76  setAndNormalToFaceZone.C
77 
78 \*---------------------------------------------------------------------------*/
79 
80 #ifndef setAndNormalToFaceZone_H
81 #define setAndNormalToFaceZone_H
82 
83 #include "topoSetFaceZoneSource.H"
84 
85 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
86 
87 namespace Foam
88 {
89 
90 /*---------------------------------------------------------------------------*\
91  Class setAndNormalToFaceZone Declaration
92 \*---------------------------------------------------------------------------*/
93 
94 class setAndNormalToFaceZone
95 :
96  public topoSetFaceZoneSource
97 {
98  // Private Data
99 
100  //- Add usage string
101  static addToUsageTable usage_;
102 
103  //- Name of set to use
104  word setName_;
105 
106  //- Normal used to orient the faces
107  vector normal_;
108 
109 
110 public:
111 
112  //- Runtime type information
113  TypeName("setAndNormalToFaceZone");
114 
115  // Constructors
116 
117  //- Construct from components
119  (
120  const polyMesh& mesh,
121  const word& setName,
122  const vector& normal
123  );
124 
125  //- Construct from dictionary
126  setAndNormalToFaceZone(const polyMesh& mesh, const dictionary& dict);
127 
128  //- Construct from Istream
129  setAndNormalToFaceZone(const polyMesh& mesh, Istream& is);
130 
131 
132  //- Destructor
133  virtual ~setAndNormalToFaceZone() = default;
134 
135 
136  // Member Functions
137 
138  virtual void applyToSet
139  (
140  const topoSetSource::setAction action,
141  topoSet& set
142  ) const;
143 };
144 
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 } // End namespace Foam
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 #endif
153 
154 // ************************************************************************* //
Foam::BitOps::set
void set(List< bool > &bools, const labelRange &range)
Set the specified range 'on' in a boolList.
Definition: BitOps.C:37
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::topoSetFaceZoneSource
The topoSetFaceZoneSource is a intermediate class for handling topoSet sources for selecting face zon...
Definition: topoSetFaceZoneSource.H:57
Foam::topoSetSource::setAction
setAction
Enumeration defining the valid actions.
Definition: topoSetSource.H:100
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::setAndNormalToFaceZone::TypeName
TypeName("setAndNormalToFaceZone")
Runtime type information.
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::topoSet
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:63
dict
dictionary dict
Definition: searchingEngine.H:14
topoSetFaceZoneSource.H
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
Foam::setAndNormalToFaceZone::applyToSet
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: setAndNormalToFaceZone.C:107
Foam::setAndNormalToFaceZone
A topoSetSource to select faces based on usage in a faceSet, where the normal vector is used to orien...
Definition: setAndNormalToFaceZone.H:147
Foam::setAndNormalToFaceZone::setAndNormalToFaceZone
setAndNormalToFaceZone(const polyMesh &mesh, const word &setName, const vector &normal)
Construct from components.
Definition: setAndNormalToFaceZone.C:68
Foam::Vector< scalar >
Foam::topoSetSource::mesh
const polyMesh & mesh() const noexcept
Reference to the mesh.
Definition: topoSetSource.H:342
Foam::setAndNormalToFaceZone::~setAndNormalToFaceZone
virtual ~setAndNormalToFaceZone()=default
Destructor.