searchableSurfaceToCell.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-2022 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::searchableSurfaceToCell
28 
29 Description
30  A \c topoSetCellSource to select cells whose cell
31  centre enclosed by a given \c searchableSurface.
32 
33  Operands:
34  \table
35  Operand | Type | Location
36  input | triSurface | $FOAM_CASE/constant/triSurface/<file>
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 searchableSurfaceToCell;
51  surfaceType <surfaceTypeName>;
52 
53  // Optional entries
54  surfaceName <surfaceName>;
55  }
56  \endverbatim
57 
58  where the entries mean:
59  \table
60  Property | Description | Type | Req'd | Dflt
61  name | Name of cellSet | word | yes | -
62  type | Type name: cellSet | word | yes | -
63  action | Action applied on cells - see below | word | yes | -
64  source | Source name: searchableSurfaceToCell | word | yes | -
65  surfaceType | The searchable surface type | word | yes | -
66  surfaceName | Name for the IOobject | word | no | mesh-name
67  \endtable
68 
69  Options for the \c action entry:
70  \verbatim
71  new | Create a new cellSet from selected cells
72  add | Add selected cells into this cellSet
73  subtract | Remove selected cells from this cellSet
74  \endverbatim
75 
76 See also
77  - Foam::topoSetSource
78  - Foam::topoSetCellSource
79 
80 SourceFiles
81  searchableSurfaceToCell.C
82 
83 \*---------------------------------------------------------------------------*/
84 
85 #ifndef Foam_searchableSurfaceToCell_H
86 #define Foam_searchableSurfaceToCell_H
87 
88 #include "topoSetCellSource.H"
89 #include "searchableSurface.H"
90 
91 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92 
93 namespace Foam
94 {
95 
96 /*---------------------------------------------------------------------------*\
97  Class searchableSurfaceToCell Declaration
98 \*---------------------------------------------------------------------------*/
99 
100 class searchableSurfaceToCell
101 :
102  public topoSetCellSource
103 {
104  // Private Data
105 
106  //- Add usage string
107  static addToUsageTable usage_;
108 
109  //- The searchableSurface
110  autoPtr<searchableSurface> surf_;
111 
112 
113  // Private Member Functions
114 
115  void combine(topoSet& set, const bool add) const;
116 
117 
118 public:
119 
120  //- Runtime type information
121  TypeName("searchableSurfaceToCell");
122 
123 
124  // Constructors
125 
126  //- Construct surface-type from dictionary
128  (
129  const word& surfaceType,
130  const polyMesh& mesh,
131  const dictionary& dict
132  );
133 
134  //- Construct from dictionary
136  (
137  const polyMesh& mesh,
138  const dictionary& dict
139  );
140 
141 
142  //- Destructor
143  virtual ~searchableSurfaceToCell() = default;
144 
145 
146  // Member Functions
147 
148  virtual void applyToSet
149  (
150  const topoSetSource::setAction action,
151  topoSet& set
152  ) const;
153 };
154 
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #endif
163 
164 // ************************************************************************* //
dictionary dict
const polyMesh & mesh() const noexcept
Reference to the mesh.
setAction
Enumeration defining various actions.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:59
searchableSurfaceToCell(const word &surfaceType, const polyMesh &mesh, const dictionary &dict)
Construct surface-type from dictionary.
TypeName("searchableSurfaceToCell")
Runtime type information.
Namespace for OpenFOAM.
virtual ~searchableSurfaceToCell()=default
Destructor.