Loading...
Searching...
No Matches
cellToCell.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-------------------------------------------------------------------------------
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::cellToCell
29
30Description
31 A \c topoSetCellSource to select all the cells from given \c cellSet(s)
32 or \c cellZone(s).
33
34 Operands:
35 \table
36 Operand | Type | Location
37 input | cellSet(s) | $FOAM_CASE/constant/polyMesh/sets/<set>
38 output | cellSet | $FOAM_CASE/constant/polyMesh/sets/<set>
39 \endtable
40
41Usage
42 Minimal example by using \c system/topoSetDict.actions:
43 \verbatim
44 {
45 // Mandatory (inherited) entries
46 name <name>;
47 type cellSet;
48 action <action>;
49
50 // Mandatory entries
51 source cellToCell;
52
53 // Conditional mandatory entries
54 // Select one of the below
55
56 // Option-1
57 sets
58 (
59 <cellSetName1>
60 <cellSetName2>
61 ...
62 );
63
64 // Option-2
65 zones
66 (
67 <cellZoneName0>
68 <cellZoneName1>
69 ...
70 );
71
72 // Option-3
73 set <cellSetName>;
74
75 // Option-4
76 zone <cellZoneName>;
77 }
78 \endverbatim
79
80 where the entries mean:
81 \table
82 Property | Description | Type | Req'd | Dflt
83 name | Name of cellSet | word | yes | -
84 type | Type name: cellSet | word | yes | -
85 action | Action applied on cells - see below | word | yes | -
86 source | Source name: cellToCell | word | yes | -
87 \endtable
88
89 Options for the \c action entry:
90 \verbatim
91 new | Create a new cellSet from selected cells
92 add | Add selected cells into this cellSet
93 subtract | Remove selected cells from this cellSet
94 \endverbatim
95
96 Options for the conditional mandatory entries (in order of precedence):
97 \verbatim
98 Entry | Description | Type | Req'd | Dflt
99 sets | Names of input cellSets | wordList | cond'l | -
100 zones | Names of input cellZones | wordList | cond'l | -
101 set | Name of input cellSet | word | cond'l | -
102 zone | Name of input cellZone | word | cond'l | -
103 \endverbatim
104
105See also
106 - Foam::topoSetSource
107 - Foam::topoSetCellSource
108
109SourceFiles
110 cellToCell.C
111
112\*---------------------------------------------------------------------------*/
113
114#ifndef Foam_cellToCell_H
115#define Foam_cellToCell_H
116
117#include "topoSetCellSource.H"
118
119// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120
121namespace Foam
122{
123
124/*---------------------------------------------------------------------------*\
125 Class cellToCell Declaration
126\*---------------------------------------------------------------------------*/
127
128class cellToCell
129:
130 public topoSetCellSource
131{
132 // Private Data
133
134 //- Add usage string
135 static addToUsageTable usage_;
136
137 //- Names of sets or zones to use
138 wordList names_;
139
140 //- Is name a set or a zone
141 const bool isZone_;
142
143
144public:
145
146 //- Runtime type information
147 TypeName("cellToCell");
148
149
150 // Constructors
151
152 //- Construct from components
153 cellToCell(const polyMesh& mesh, const word& setName);
154
155 //- Construct from dictionary
156 cellToCell(const polyMesh& mesh, const dictionary& dict);
157
158 //- Construct from Istream
159 cellToCell(const polyMesh& mesh, Istream& is);
160
161
162 //- Destructor
163 virtual ~cellToCell() = default;
164
166 // Member Functions
167
168 virtual void applyToSet
169 (
170 const topoSetSource::setAction action,
171 topoSet& set
172 ) const;
173};
174
175
176// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177
178} // End namespace Foam
179
180// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181
182#endif
183
184// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
A topoSetCellSource to select all the cells from given cellSet(s) or cellZone(s).
Definition cellToCell.H:168
virtual ~cellToCell()=default
Destructor.
TypeName("cellToCell")
Runtime type information.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition cellToCell.C:88
cellToCell(const polyMesh &mesh, const word &setName)
Construct from components.
Definition cellToCell.C:50
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
The topoSetCellSource is a intermediate class for handling topoSet sources for selecting cells.
topoSetCellSource(const polyMesh &mesh)
Construct from mesh.
Class with constructor to add usage string to table.
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:63
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
List< word > wordList
List of word.
Definition fileName.H:60
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68