cellToFace.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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::cellToFace
29
30Description
31 A \c topoSetFaceSource to select all the faces from given \c cellSet(s).
32
33 Operands:
34 \table
35 Operand | Type | Location
36 input | cellSet(s) | $FOAM_CASE/constant/polyMesh/sets/<set>
37 output | faceSet | $FOAM_CASE/constant/polyMesh/sets/<set>
38 \endtable
39
40Usage
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 cellToFace;
51 option <option>;
52
53 // Conditional mandatory entries
54 // Select either of the below
55
56 // Option-1
57 sets
58 (
59 <cellSetName1>
60 <cellSetName2>
61 ...
62 );
63
64 // Option-2
65 set <cellSetName>;
66 }
67 \endverbatim
68
69 where the entries mean:
70 \table
71 Property | Description | Type | Req'd | Dflt
72 name | Name of faceSet | word | yes | -
73 type | Type name: faceSet | word | yes | -
74 action | Action applied on faces - see below | word | yes | -
75 source | Source name: cellToFace | word | yes | -
76 option | Selection type - see below | word | yes | -
77 \endtable
78
79 Options for the \c action entry:
80 \verbatim
81 new | Create a new faceSet from selected cells of cellSet(s)
82 add | Add selected faces of cellSet(s) into this faceSet
83 subtract | Remove selected faces of cellSet(s) from this faceSet
84 \endverbatim
85
86 Options for the \c option entry:
87 \verbatim
88 all | All faces of cells in the cellSet
89 both | Faces where both neighbours are in the cellSet
90 \endverbatim
91
92 Options for the conditional mandatory entries:
93 \verbatim
94 Entry | Description | Type | Req'd | Dflt
95 sets | Names of input cellSets | wordList | cond'l | -
96 set | Name of input cellSet | word | cond'l | -
97 \endverbatim
98
99Note
100 The order of precedence among the conditional mandatory entries from the
101 highest to the lowest is \c sets, and \c set.
102
103See also
104 - Foam::topoSetSource
105 - Foam::topoSetFaceSource
106
107SourceFiles
108 cellToFace.C
109
110\*---------------------------------------------------------------------------*/
111
112#ifndef cellToFace_H
113#define cellToFace_H
114
115#include "topoSetFaceSource.H"
116#include "Enum.H"
117
118// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119
120namespace Foam
121{
122
123/*---------------------------------------------------------------------------*\
124 Class cellToFace Declaration
125\*---------------------------------------------------------------------------*/
126
127class cellToFace
128:
129 public topoSetFaceSource
130{
131public:
132 //- Enumeration defining the valid options
133 enum cellAction
134 {
135 ALL,
136 BOTH
137 };
138
139
140private:
141
142 // Private Data
143
144 //- Add usage string
145 static addToUsageTable usage_;
146
147 static const Enum<cellAction> cellActionNames_;
148
149 //- Names of cellSets to use
150 wordList names_;
151
152 //- Selection type
153 cellAction option_;
154
155
156 // Private Member Functions
157
158 //- Depending on face to cell option add to or delete from cellSet.
159 void combine(topoSet& set, const bool add, const word& setName) const;
160
161
162public:
163
164 //- Runtime type information
165 TypeName("cellToFace");
166
167
168 // Constructors
169
170 //- Construct from components
172 (
173 const polyMesh& mesh,
174 const word& setName,
175 const cellAction option
176 );
177
178 //- Construct from dictionary
179 cellToFace(const polyMesh& mesh, const dictionary& dict);
181 //- Construct from Istream
183
185 //- Destructor
186 virtual ~cellToFace() = default;
187
188
189 // Member Functions
190
191 virtual void applyToSet
192 (
193 const topoSetSource::setAction action,
194 topoSet& set
195 ) const;
196};
197
198
199// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200
201} // End namespace Foam
202
203// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204
205#endif
206
207// ************************************************************************* //
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
A topoSetFaceSource to select all the faces from given cellSet(s).
Definition: cellToFace.H:177
cellToFace(const polyMesh &mesh, const word &setName, const cellAction option)
Construct from components.
Definition: cellToFace.C:157
virtual ~cellToFace()=default
Destructor.
cellAction
Enumeration defining the valid options.
Definition: cellToFace.H:181
TypeName("cellToFace")
Runtime type information.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: cellToFace.C:203
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
The topoSetFaceSource is a intermediate class for handling topoSet sources for selecting faces.
setAction
Enumeration defining various actions.
const polyMesh & mesh() const noexcept
Reference to the mesh.
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:67
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
List< word > wordList
A List of words.
Definition: fileName.H:63
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73