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 "topoSetSource.H"
85 
86 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
87 
88 namespace Foam
89 {
90 
91 /*---------------------------------------------------------------------------*\
92  Class faceZoneToFaceZone Declaration
93 \*---------------------------------------------------------------------------*/
94 
95 class faceZoneToFaceZone
96 :
97  public topoSetSource
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
118  (
119  const polyMesh& mesh,
120  const word& setName
121  );
122 
123  //- Construct from dictionary
124  faceZoneToFaceZone(const polyMesh& mesh, const dictionary& dict);
125 
126  //- Construct from Istream
127  faceZoneToFaceZone(const polyMesh& mesh, Istream& is);
128 
129 
130  //- Destructor
131  virtual ~faceZoneToFaceZone() = default;
132 
133 
134  // Member Functions
135 
136  //- The source category is a faceZone
137  virtual topoSetSource::sourceType setType() const
138  {
139  return FACEZONE_SOURCE;
140  }
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::topoSetSource::sourceType
sourceType
Enumeration defining the types of sources.
Definition: topoSetSource.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::faceZoneToFaceZone::applyToSet
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: faceZoneToFaceZone.C:90
Foam::faceZoneToFaceZone
A topoSetSource to select faces of a given faceZone.
Definition: faceZoneToFaceZone.H:146
Foam::faceZoneToFaceZone::setType
virtual topoSetSource::sourceType setType() const
The source category is a faceZone.
Definition: faceZoneToFaceZone.H:188
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::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
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::faceZoneToFaceZone::TypeName
TypeName("faceZoneToFaceZone")
Runtime type information.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::topoSetSource
Base class of a source for a topoSet.
Definition: topoSetSource.H:66
Foam::topoSetSource::FACEZONE_SOURCE
Faces as zone.
Definition: topoSetSource.H:87
topoSetSource.H
Foam::faceZoneToFaceZone::faceZoneToFaceZone
faceZoneToFaceZone(const polyMesh &mesh, const word &setName)
Construct from components.
Definition: faceZoneToFaceZone.C:55