boundaryToCell.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) 2018-2020 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::boundaryToCell
28 
29 Description
30  A \c topoSetCellSource to select all cells possessing
31  at least a single face on all external boundaries.
32 
33  Operands:
34  \table
35  Operand | Type | Location
36  output | cellSet | $FOAM_CASE/constant/polyMesh/sets/<set>
37  \endtable
38 
39 Usage
40  Minimal example by using \c system/topoSetDict.actions:
41  \verbatim
42  {
43  // Mandatory (inherited) entries
44  name <name>;
45  type cellSet;
46  action <action>;
47 
48  // Mandatory entries
49  source boundaryToCell;
50  }
51  \endverbatim
52 
53  where the entries mean:
54  \table
55  Property | Description | Type | Req'd | Dflt
56  name | Name of cellSet | word | yes | -
57  type | Type name: cellSet | word | yes | -
58  action | Action applied on cells - see below | word | yes | -
59  source | Source name: boundaryToCell | word | yes | -
60  \endtable
61 
62  Options for the \c action entry:
63  \verbatim
64  new | Create a new cellSet from selected cells
65  add | Add selected cells into this cellSet
66  subtract | Remove selected cells from this cellSet
67  \endverbatim
68 
69 See also
70  - Foam::topoSetSource
71  - Foam::topoSetCellSource
72  - Foam::patchToCell
73 
74 SourceFiles
75  boundaryToCell.C
76 
77 \*---------------------------------------------------------------------------*/
78 
79 #ifndef boundaryToCell_H
80 #define boundaryToCell_H
81 
82 #include "topoSetCellSource.H"
83 
84 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85 
86 namespace Foam
87 {
88 
89 /*---------------------------------------------------------------------------*\
90  Class boundaryToCell Declaration
91 \*---------------------------------------------------------------------------*/
92 
93 class boundaryToCell
94 :
95  public topoSetCellSource
96 {
97  // Private Data
98 
99  //- Add usage string
100  static addToUsageTable usage_;
101 
102 
103  // Private Member Functions
104 
105  void combine(topoSet& set, const bool add) const;
106 
107 
108 public:
109 
110  //- Runtime type information
111  TypeName("boundaryToCell");
112 
113 
114  // Constructors
115 
116  //- Construct from components
117  boundaryToCell(const polyMesh& mesh);
118 
119  //- Construct from dictionary
120  boundaryToCell(const polyMesh& mesh, const dictionary& unused);
121 
122  //- Construct from Istream
123  boundaryToCell(const polyMesh& mesh, Istream& unused);
124 
125 
126  //- Destructor
127  virtual ~boundaryToCell() = 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::boundaryToCell::boundaryToCell
boundaryToCell(const polyMesh &mesh)
Construct from components.
Definition: boundaryToCell.C:84
Foam::BitOps::set
void set(List< bool > &bools, const labelRange &range)
Set the specified range 'on' in a boolList.
Definition: BitOps.C:37
Foam::boundaryToCell::TypeName
TypeName("boundaryToCell")
Runtime type information.
Foam::combine
Definition: FaceCellWave.C:57
Foam::topoSetSource::addToUsageTable
Class with constructor to add usage string to table.
Definition: topoSetSource.H:129
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::boundaryToCell::applyToSet
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: boundaryToCell.C:113
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
topoSetCellSource.H
Foam::boundaryToCell::~boundaryToCell
virtual ~boundaryToCell()=default
Destructor.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::add
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Definition: FieldFieldFunctions.C:939
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::topoSetCellSource
The topoSetCellSource is a intermediate class for handling topoSet sources for selecting cells.
Definition: topoSetCellSource.H:54
Foam::boundaryToCell
A topoSetCellSource to select all cells possessing at least a single face on all external boundaries.
Definition: boundaryToCell.H:130
Foam::topoSetSource::mesh
const polyMesh & mesh() const noexcept
Reference to the mesh.
Definition: topoSetSource.H:342