faceZoneToFaceZone.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::faceZoneToFaceZone
29 
30 Description
31  A \c topoSetSource to select faces of a given \c faceZone.
32 
33  Operands:
34  \table
35  Operand | Type | Location
36  input | faceSet | $FOAM_CASE/constant/polyMesh/sets/<set>
37  output 1 | faceSet | $FOAM_CASE/constant/polyMesh/sets/<set>
38  output 2 | 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 faceZoneToFaceZone;
52  zone <faceZoneName>;
53  }
54  \endverbatim
55 
56  where the entries mean:
57  \table
58  Property | Description | Type | Req'd | Dflt
59  name | Name of faceZone | word | yes | -
60  type | Type name: faceZoneSet | word | yes | -
61  action | Action applied on faces - see below | word | yes | -
62  source | Source name: faceZoneToFaceZone | word | yes | -
63  zone | Name of input faceZone | word | yes | -
64  \endtable
65 
66  Options for the \c action entry:
67  \verbatim
68  new | Create a new faceZone from selected faces of a faceZone
69  add | Add selected faces of a faceZone into this faceZone
70  subtract | Remove selected faces of a faceZone from this faceZone
71  \endverbatim
72 
73 See also
74  - Foam::topoSetSource
75 
76 SourceFiles
77  faceZoneToFaceZone.C
78 
79 \*---------------------------------------------------------------------------*/
80 
81 #ifndef faceZoneToFaceZone_H
82 #define faceZoneToFaceZone_H
83 
84 #include "topoSetFaceZoneSource.H"
85 
86 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
87 
88 namespace Foam
89 {
90 
91 /*---------------------------------------------------------------------------*\
92  Class faceZoneToFaceZone Declaration
93 \*---------------------------------------------------------------------------*/
94 
95 class faceZoneToFaceZone
96 :
97  public topoSetFaceZoneSource
98 {
99  // Private Data
100 
101  //- Add usage string
102  static addToUsageTable usage_;
103 
104  //- Name of set to use
105  word setName_;
106 
107 
108 public:
109 
110  //- Runtime type information
111  TypeName("faceZoneToFaceZone");
112 
113 
114  // Constructors
115 
116  //- Construct from components
117  faceZoneToFaceZone(const polyMesh& mesh, const word& setName);
118 
119  //- Construct from dictionary
120  faceZoneToFaceZone(const polyMesh& mesh, const dictionary& dict);
121 
122  //- Construct from Istream
123  faceZoneToFaceZone(const polyMesh& mesh, Istream& is);
124 
125 
126  //- Destructor
127  virtual ~faceZoneToFaceZone() = default;
128 
129 
130  // Member Functions
131 
132  virtual void applyToSet
133  (
134  const topoSetSource::setAction action,
135  topoSet& set
136  ) const;
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #endif
147 
148 // ************************************************************************* //
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::faceZoneToFaceZone::applyToSet
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: faceZoneToFaceZone.C:103
Foam::faceZoneToFaceZone
A topoSetSource to select faces of a given faceZone.
Definition: faceZoneToFaceZone.H:146
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::faceZoneToFaceZone::~faceZoneToFaceZone
virtual ~faceZoneToFaceZone()=default
Destructor.
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::faceZoneToFaceZone::TypeName
TypeName("faceZoneToFaceZone")
Runtime type information.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::topoSetSource::mesh
const polyMesh & mesh() const noexcept
Reference to the mesh.
Definition: topoSetSource.H:342
Foam::faceZoneToFaceZone::faceZoneToFaceZone
faceZoneToFaceZone(const polyMesh &mesh, const word &setName)
Construct from components.
Definition: faceZoneToFaceZone.C:68