faceToFace.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-2024 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::faceToFace
29 
30 Description
31  A \c topoSetFaceSource to select faces based on usage in another \c faceSet.
32 
33  Operands:
34  \table
35  Operand | Type | Location
36  input | faceSet | $FOAM_CASE/constant/polyMesh/sets/<set>
37  output | faceSet | $FOAM_CASE/constant/polyMesh/sets/<set>
38  \endtable
39 
40 Usage
41  Minimal example by using \c system/topoSetDict.actions:
42  \verbatim
43  {
44  // Mandatory (inherited) entries
45  name <name>;
46  type faceSet;
47  action <action>;
48 
49  // Mandatory entries
50  source faceToFace;
51 
52  // Conditional mandatory entries
53  // Select one of the below
54 
55  // Option-1
56  sets
57  (
58  <faceSetName0>
59  <faceSetName1>
60  ...
61  );
62 
63  // Option-2
64  zones
65  (
66  <faceZoneName0>
67  <faceZoneName1>
68  ...
69  );
70 
71  // Option-3
72  set <faceSetName>;
73 
74  // Option-4
75  zone <faceZoneName>;
76  }
77  \endverbatim
78 
79  where the entries mean:
80  \table
81  Property | Description | Type | Req'd | Dflt
82  name | Name of faceSet | word | yes | -
83  type | Type name: faceSet | word | yes | -
84  action | Action applied on faces - see below | word | yes | -
85  source | Source name: faceToFace | word | yes | -
86  \endtable
87 
88  Options for the \c action entry:
89  \verbatim
90  new | Create a new faceSet from selected faces
91  add | Add selected faces into this faceSet
92  subtract | Remove selected faces from this faceSet
93  \endverbatim
94 
95  Options for the conditional mandatory entries (in order of precedence):
96  \verbatim
97  Entry | Description | Type | Req'd | Dflt
98  sets | Names of input faceSets | wordList | cond'l | -
99  zones | Names of input faceZones | wordList | cond'l | -
100  set | Name of input faceSet | word | cond'l | -
101  zone | Name of input faceZone | word | cond'l | -
102  \endverbatim
103 
104 Note
105  The order of precedence among the conditional mandatory entries from the
106  highest to the lowest is \c sets, and \c set.
107 
108 See also
109  - Foam::topoSetSource
110  - Foam::topoSetFaceSource
111 
112 SourceFiles
113  faceToFace.C
114 
115 \*---------------------------------------------------------------------------*/
116 
117 #ifndef Foam_faceToFace_H
118 #define Foam_faceToFace_H
119 
120 #include "topoSetFaceSource.H"
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 namespace Foam
125 {
126 
127 /*---------------------------------------------------------------------------*\
128  Class faceToFace Declaration
129 \*---------------------------------------------------------------------------*/
130 
131 class faceToFace
132 :
133  public topoSetFaceSource
134 {
135  // Private Data
136 
137  //- Add usage string
138  static addToUsageTable usage_;
139 
140  //- Names of sets or zones to use
141  wordList names_;
142 
143  //- Is name a set or a zone
144  const bool isZone_;
145 
146 
147 public:
148 
149  //- Runtime type information
150  TypeName("faceToFace");
151 
152 
153  // Constructors
154 
155  //- Construct from components
156  faceToFace(const polyMesh& mesh, const word& setName);
157 
158  //- Construct from dictionary
159  faceToFace(const polyMesh& mesh, const dictionary& dict);
160 
161  //- Construct from Istream
162  faceToFace(const polyMesh& mesh, Istream& is);
163 
164 
165  //- Destructor
166  virtual ~faceToFace() = default;
167 
169  // Member Functions
170 
171  virtual void applyToSet
172  (
173  const topoSetSource::setAction action,
174  topoSet& set
175  ) const;
176 };
177 
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 } // End namespace Foam
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 #endif
186 
187 // ************************************************************************* //
dictionary dict
TypeName("faceToFace")
Runtime type information.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: faceToFace.C:88
const polyMesh & mesh() const noexcept
Reference to the mesh.
setAction
Enumeration defining various actions.
virtual ~faceToFace()=default
Destructor.
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:59
List< word > wordList
List of word.
Definition: fileName.H:59
faceToFace(const polyMesh &mesh, const word &setName)
Construct from components.
Definition: faceToFace.C:50
Namespace for OpenFOAM.