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