haloToCell.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) 2019-2021 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::haloToCell
28
29Description
30 A \c topoSetCellSource to select cells attached to the outside
31 of this \c cellSet, and add into/remove from this \c cellSet.
32
33 Operands:
34 \table
35 Operand | Type | Location
36 input | cellSet | $FOAM_CASE/constant/polyMesh/sets/<set>
37 output | cellSet | $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 cellSet;
47 action <action>;
48
49 // Mandatory entries
50 source haloToCell;
51
52 // Optional entries
53 steps 1;
54 }
55 \endverbatim
56
57 where the entries mean:
58 \table
59 Property | Description | Type | Req'd | Dflt
60 name | Name of cellSet | word | yes | -
61 type | Type name: cellSet | word | yes | -
62 action | Action applied on cells - see below | word | yes | -
63 source | Source name: haloToCell | word | yes | -
64 steps | Number of grow/shrink steps to use | label | no | 1
65 \endtable
66
67 Options for the \c action entry:
68 \verbatim
69 add | Add selected cells into this cellSet
70 subtract | Remove selected cells from this cellSet
71 \endverbatim
72
73Note
74 - \c action=new is not available for \c haloToCell.
75 - When removing halo cells, this strips off
76 any cells on the boundary of the cellSet.
77
78See also
79 - Foam::topoSetSource
80 - Foam::topoSetCellSource
81
82SourceFiles
83 haloToCell.C
84
85\*---------------------------------------------------------------------------*/
86
87#ifndef haloToCell_H
88#define haloToCell_H
89
90#include "topoSetCellSource.H"
91
92// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
93
94namespace Foam
95{
96
97/*---------------------------------------------------------------------------*\
98 Class haloToCell Declaration
99\*---------------------------------------------------------------------------*/
100
101class haloToCell
102:
103 public topoSetCellSource
104{
105 // Private Data
106
107 //- Add usage string
108 static addToUsageTable usage_;
109
110 //- Number of grow/shrink steps
111 label steps_;
112
113
114 // Private Member Functions
115
116 void combine(topoSet& set, const bool add) const;
117
118
119public:
120
121 //- Runtime type information
122 TypeName("haloToCell");
123
124
125 // Constructors
126
127 //- Construct from components
128 explicit haloToCell(const polyMesh& mesh, const label nsteps=1);
129
130 //- Construct from dictionary
131 haloToCell(const polyMesh& mesh, const dictionary& dict);
132
133 //- Construct from Istream
134 haloToCell(const polyMesh& mesh, Istream& is);
135
136
137 //- Destructor
138 virtual ~haloToCell() = default;
139
140
141 // Member Functions
142
143 //- The number of steps to grow/shrink
144 label steps() const noexcept;
145
146 //- Set number of steps to grow/shrink, return the old value
147 label steps(const label nsteps) noexcept;
149
150 virtual void applyToSet
151 (
152 const topoSetSource::setAction action,
153 topoSet& set
154 ) const;
155};
156
157
158// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159
160} // End namespace Foam
161
162// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163
164#endif
165
166// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A topoSetCellSource to select cells attached to the outside of this cellSet, and add into/remove from...
Definition: haloToCell.H:151
virtual ~haloToCell()=default
Destructor.
label steps() const noexcept
The number of steps to grow/shrink.
Definition: haloToCell.C:215
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: haloToCell.C:230
TypeName("haloToCell")
Runtime type information.
haloToCell(const polyMesh &mesh, const label nsteps=1)
Construct from components.
Definition: haloToCell.C:183
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
The topoSetCellSource is a intermediate class for handling topoSet sources for selecting cells.
Class with constructor to add usage string to table.
Base class of a source for a topoSet.
Definition: topoSetSource.H:68
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
AccessType combine(const UList< T > &lists, AccessOp aop=accessOp< T >())
Combines sub-lists into a single list.
Definition: ListListOps.C:69
Namespace for OpenFOAM.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
const direction noexcept
Definition: Scalar.H:223
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73