setToCellZone.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-2019 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::setToCellZone
29 
30 Description
31  A topoSetSource to select cells based on usage in a cellSet.
32 
33  \heading Dictionary parameters
34  \table
35  Property | Description | Required | Default
36  set | The cell set name | yes |
37  \endtable
38 
39 SourceFiles
40  setToCellZone.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef setToCellZone_H
45 #define setToCellZone_H
46 
47 #include "topoSetSource.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class setToCellZone Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class setToCellZone
59 :
60  public topoSetSource
61 {
62  // Private data
63 
64  //- Add usage string
65  static addToUsageTable usage_;
66 
67  //- Name of set to use
68  word setName_;
69 
70 public:
71 
72  //- Runtime type information
73  TypeName("setToCellZone");
74 
75  // Constructors
76 
77  //- Construct from components
78  setToCellZone(const polyMesh& mesh, const word& setName);
79 
80  //- Construct from dictionary
81  setToCellZone(const polyMesh& mesh, const dictionary& dict);
82 
83  //- Construct from Istream
84  setToCellZone(const polyMesh& mesh, Istream& is);
85 
86 
87  //- Destructor
88  virtual ~setToCellZone() = default;
89 
90 
91  // Member Functions
92 
93  //- The source category is a cellZone
94  virtual topoSetSource::sourceType setType() const
95  {
96  return CELLZONE_SOURCE;
97  }
98 
99  virtual void applyToSet
100  (
101  const topoSetSource::setAction action,
102  topoSet& set
103  ) const;
104 };
105 
106 
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 
109 } // End namespace Foam
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 #endif
114 
115 // ************************************************************************* //
Foam::topoSetSource::sourceType
sourceType
Enumeration defining the types of sources.
Definition: topoSetSource.H:73
Foam::setToCellZone::TypeName
TypeName("setToCellZone")
Runtime type information.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::topoSetSource::setAction
setAction
Enumeration defining the valid actions.
Definition: topoSetSource.H:99
Foam::setToCellZone::applyToSet
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: setToCellZone.C:90
Foam::topoSetSource::mesh
const polyMesh & mesh() const
Reference to the mesh.
Definition: topoSetSource.H:333
Foam::topoSetSource::CELLZONE_SOURCE
Cells as zone.
Definition: topoSetSource.H:86
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::setToCellZone::setType
virtual topoSetSource::sourceType setType() const
The source category is a cellZone.
Definition: setToCellZone.H:103
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::topoSet
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:66
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:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::topoSetSource
Base class of a source for a topoSet.
Definition: topoSetSource.H:66
topoSetSource.H
Foam::setToCellZone
A topoSetSource to select cells based on usage in a cellSet.
Definition: setToCellZone.H:67
Foam::setToCellZone::~setToCellZone
virtual ~setToCellZone()=default
Destructor.
Foam::setToCellZone::setToCellZone
setToCellZone(const polyMesh &mesh, const word &setName)
Construct from components.
Definition: setToCellZone.C:55