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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::cellToCell
29 
30 Description
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 
40 Usage
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 
91 Note
92  The order of precedence among the conditional mandatory entries from the
93  highest to the lowest is \c sets, and \c set.
94 
95 See also
96  - Foam::topoSetSource
97  - Foam::topoSetCellSource
98 
99 SourceFiles
100  cellToCell.C
101 
102 \*---------------------------------------------------------------------------*/
103 
104 #ifndef cellToCell_H
105 #define cellToCell_H
106 
107 #include "topoSetCellSource.H"
108 
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 
111 namespace Foam
112 {
113 
114 /*---------------------------------------------------------------------------*\
115  Class cellToCell Declaration
116 \*---------------------------------------------------------------------------*/
117 
118 class 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 
131 public:
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 // ************************************************************************* //
Foam::BitOps::set
void set(List< bool > &bools, const labelRange &range)
Set the specified range 'on' in a boolList.
Definition: BitOps.C:37
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
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::wordList
List< word > wordList
A List of words.
Definition: fileName.H:62
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::cellToCell
A topoSetCellSource to select all the cells from given cellSet(s).
Definition: cellToCell.H:159
Foam::topoSet
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:63
topoSetCellSource.H
Foam::cellToCell::applyToSet
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: cellToCell.C:99
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::cellToCell::cellToCell
cellToCell(const polyMesh &mesh, const word &setName)
Construct from components.
Definition: cellToCell.C:57
Foam::cellToCell::~cellToCell
virtual ~cellToCell()=default
Destructor.
Foam::List< word >
Foam::cellToCell::TypeName
TypeName("cellToCell")
Runtime type information.
Foam::topoSetCellSource
The topoSetCellSource is a intermediate class for handling topoSet sources for selecting cells.
Definition: topoSetCellSource.H:54
Foam::topoSetSource::mesh
const polyMesh & mesh() const noexcept
Reference to the mesh.
Definition: topoSetSource.H:342