setToPointZone.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::setToPointZone
29 
30 Description
31  A \c topoSetSource to convert a \c pointSet
32  to a \c pointZone (and associated \c pointSet).
33 
34  Operands:
35  \table
36  Operand | Type | Location
37  input | pointSet | $FOAM_CASE/constant/polyMesh/sets/<set>
38  output 1 | pointSet | $FOAM_CASE/constant/polyMesh/sets/<set>
39  output 2 | pointZone | $FOAM_CASE/constant/polyMesh/pointZones
40  \endtable
41 
42 Usage
43  Minimal example by using \c system/topoSetDict.actions:
44  \verbatim
45  {
46  // Mandatory (inherited) entries
47  name <name>;
48  type pointZoneSet;
49  action <action>;
50 
51  // Mandatory entries
52  source setToCellZone;
53  set <pointSetName>;
54  }
55  \endverbatim
56 
57  where the entries mean:
58  \table
59  Property | Description | Type | Req'd | Dflt
60  name | Name of pointZone | word | yes | -
61  type | Type name: pointZoneSet | word | yes | -
62  action | Action applied on points - see below | word | yes | -
63  source | Source name: setToPointZone | word | yes | -
64  set | Name of input pointSet | word | yes | -
65  \endtable
66 
67  Options for the \c action entry:
68  \verbatim
69  new | Create a new pointZone from selected points of a pointSet
70  add | Add selected points of a pointSet into this pointZone
71  subtract | Remove selected points of a pointSet from this pointZone
72  \endverbatim
73 
74 See also
75  - Foam::topoSetSource
76  - Foam::topoSetPointSource
77 
78 SourceFiles
79  setToPointZone.C
80 
81 \*---------------------------------------------------------------------------*/
82 
83 #ifndef setToPointZone_H
84 #define setToPointZone_H
85 
86 #include "topoSetSource.H"
87 
88 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
89 
90 namespace Foam
91 {
92 
93 /*---------------------------------------------------------------------------*\
94  Class setToPointZone Declaration
95 \*---------------------------------------------------------------------------*/
96 
97 class setToPointZone
98 :
99  public topoSetSource
100 {
101  // Private Data
102 
103  //- Add usage string
104  static addToUsageTable usage_;
105 
106  //- Name of set to use
107  word setName_;
108 
109 
110 public:
111 
112  //- Runtime type information
113  TypeName("setToPointZone");
114 
115 
116  // Constructors
117 
118  //- Construct from components
120  (
121  const polyMesh& mesh,
122  const word& setName
123  );
124 
125  //- Construct from dictionary
126  setToPointZone(const polyMesh& mesh, const dictionary& dict);
127 
128  //- Construct from Istream
129  setToPointZone(const polyMesh& mesh, Istream& is);
130 
131 
132  //- Destructor
133  virtual ~setToPointZone() = default;
134 
135 
136  // Member Functions
137 
138  //- The source category is a pointZone
139  virtual topoSetSource::sourceType setType() const
140  {
141  return POINTZONE_SOURCE;
142  }
143 
144  virtual void applyToSet
145  (
146  const topoSetSource::setAction action,
147  topoSet& set
148  ) const;
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #endif
159 
160 // ************************************************************************* //
Foam::topoSetSource::POINTZONE_SOURCE
Points as zone.
Definition: topoSetSource.H:88
Foam::topoSetSource::sourceType
sourceType
Enumeration defining the types of sources.
Definition: topoSetSource.H:73
Foam::setToPointZone::setToPointZone
setToPointZone(const polyMesh &mesh, const word &setName)
Construct from components.
Definition: setToPointZone.C:55
Foam::setToPointZone
A topoSetSource to convert a pointSet to a pointZone (and associated pointSet).
Definition: setToPointZone.H:148
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::setToPointZone::setType
virtual topoSetSource::sourceType setType() const
The source category is a pointZone.
Definition: setToPointZone.H:190
Foam::setToPointZone::TypeName
TypeName("setToPointZone")
Runtime type information.
Foam::topoSetSource::setAction
setAction
Enumeration defining the valid actions.
Definition: topoSetSource.H:99
Foam::topoSetSource::mesh
const polyMesh & mesh() const
Reference to the mesh.
Definition: topoSetSource.H:333
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
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:63
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
Foam::setToPointZone::~setToPointZone
virtual ~setToPointZone()=default
Destructor.
Foam::setToPointZone::applyToSet
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: setToPointZone.C:90
topoSetSource.H