The open source CFD toolbox
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-2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
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
33 Operands:
34 \table
35 Operand | Type | Location
36 input | cellSet(s) | $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 cellToCell;
51
52 // Conditional mandatory entries
53 // Select either of the below
54
55 // Option-1
56 sets
57 (
58 <cellSetName1>
59 <cellSetName2>
60 ...
61 );
62
63 // Option-2
64 set <cellSetName>;
65 }
66 \endverbatim
67
68 where the entries mean:
69 \table
70 Property | Description | Type | Req'd | Dflt
71 name | Name of cellSet | word | yes | -
72 type | Type name: cellSet | word | yes | -
73 action | Action applied on cells - see below | word | yes | -
74 source | Source name: cellToCell | word | yes | -
75 \endtable
76
77 Options for the \c action entry:
78 \verbatim
79 new | Create a new cellSet from selected cells
80 add | Add selected cells into this cellSet
81 subtract | Remove selected cells from this cellSet
82 \endverbatim
83
84 Options for the conditional mandatory entries:
85 \verbatim
86 Entry | Description | Type | Req'd | Dflt
87 sets | Names of input cellSets | wordList | cond'l | -
88 set | Name of input cellSet | word | cond'l | -
89 \endverbatim
90
91Note
92 The order of precedence among the conditional mandatory entries from the
93 highest to the lowest is \c sets, and \c set.
94
96 - Foam::topoSetSource
97 - Foam::topoSetCellSource
98
99SourceFiles
100 cellToCell.C
101
102\*---------------------------------------------------------------------------*/
103
104#ifndef cellToCell_H
105#define cellToCell_H
106
107#include "topoSetCellSource.H"
108
109// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110
111namespace Foam
112{
113
114/*---------------------------------------------------------------------------*\
115 Class cellToCell Declaration
116\*---------------------------------------------------------------------------*/
117
118class cellToCell
119:
120 public topoSetCellSource
121{
122 // Private Data
123
124 //- Add usage string
125 static addToUsageTable usage_;
126
127 //- Names of sets to use
128 wordList names_;
129
130
131public:
132
133 //- Runtime type information
134 TypeName("cellToCell");
135
136
137 // Constructors
138
139 //- Construct from components
140 cellToCell(const polyMesh& mesh, const word& setName);
141
142 //- Construct from dictionary
143 cellToCell(const polyMesh& mesh, const dictionary& dict);
144
145 //- Construct from Istream
146 cellToCell(const polyMesh& mesh, Istream& is);
147
148
149 //- Destructor
150 virtual ~cellToCell() = 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// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
A topoSetCellSource to select all the cells from given cellSet(s).
Definition: cellToCell.H:162
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:99
cellToCell(const polyMesh &mesh, const word &setName)
Construct from components.
Definition: cellToCell.C:57
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 topoSetCellSource is a intermediate class for handling topoSet sources for selecting cells.
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: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
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73