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-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::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 either of the below
54 
55  // Option-1
56  sets
57  (
58  <faceSetName0>
59  <faceSetName1>
60  ...
61  );
62 
63  // Option-2
64  set <faceSetName>;
65  }
66  \endverbatim
67 
68  where the entries mean:
69  \table
70  Property | Description | Type | Req'd | Dflt
71  name | Name of faceSet | word | yes | -
72  type | Type name: faceSet | word | yes | -
73  action | Action applied on faces - see below | word | yes | -
74  source | Source name: faceToFace | word | yes | -
75  \endtable
76 
77  Options for the \c action entry:
78  \verbatim
79  new | Create a new faceSet from selected faces
80  add | Add selected faces into this faceSet
81  subtract | Remove selected faces from this faceSet
82  \endverbatim
83 
84  Options for the conditional mandatory entries:
85  \verbatim
86  Entry | Description | Type | Req'd | Dflt
87  sets | Names of input faceSets | wordList | cond'l | -
88  set | Name of input faceSet | word | cond'l | -
89  \endverbatim
90 
91 Note
92  The order of precedence among the conditional mandatory entries from the
93  highest to the lowest is \c sets, and \c set.
94 
95 See also
96  - Foam::topoSetSource
97  - Foam::topoSetFaceSource
98 
99 SourceFiles
100  faceToFace.C
101 
102 \*---------------------------------------------------------------------------*/
103 
104 #ifndef faceToFace_H
105 #define faceToFace_H
106 
107 #include "topoSetFaceSource.H"
108 
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 
111 namespace Foam
112 {
113 
114 /*---------------------------------------------------------------------------*\
115  Class faceToFace Declaration
116 \*---------------------------------------------------------------------------*/
117 
118 class faceToFace
119 :
120  public topoSetFaceSource
121 {
122  // Private Data
123 
124  //- Add usage string
125  static addToUsageTable usage_;
126 
127  //- Names of faceSets to use
128  wordList names_;
129 
130 
131 public:
132 
133  //- Runtime type information
134  TypeName("faceToFace");
135 
136 
137  // Constructors
138 
139  //- Construct from components
140  faceToFace(const polyMesh& mesh, const word& setName);
141 
142  //- Construct from dictionary
143  faceToFace(const polyMesh& mesh, const dictionary& dict);
144 
145  //- Construct from Istream
146  faceToFace(const polyMesh& mesh, Istream& is);
147 
148 
149  //- Destructor
150  virtual ~faceToFace() = default;
151 
152 
153  // Member Functions
154 
155  virtual void applyToSet
156  (
157  const topoSetSource::setAction action,
158  topoSet& set
159  ) const;
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
Foam::faceToFace::TypeName
TypeName("faceToFace")
Runtime type information.
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::topoSetSource::addToUsageTable
Class with constructor to add usage string to table.
Definition: topoSetSource.H:129
Foam::faceToFace::faceToFace
faceToFace(const polyMesh &mesh, const word &setName)
Construct from components.
Definition: faceToFace.C:57
Foam::topoSetSource::setAction
setAction
Enumeration defining the valid actions.
Definition: topoSetSource.H:100
Foam::topoSetFaceSource
The topoSetFaceSource is a intermediate class for handling topoSet sources for selecting faces.
Definition: topoSetFaceSource.H:54
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::wordList
List< word > wordList
A List of words.
Definition: fileName.H:62
Foam::faceToFace
A topoSetFaceSource to select faces based on usage in another faceSet.
Definition: faceToFace.H:159
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::faceToFace::applyToSet
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: faceToFace.C:99
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:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::faceToFace::~faceToFace
virtual ~faceToFace()=default
Destructor.
Foam::List< word >
Foam::topoSetSource::mesh
const polyMesh & mesh() const noexcept
Reference to the mesh.
Definition: topoSetSource.H:342
topoSetFaceSource.H