zoneToPoint.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::zoneToPoint
29 
30 Description
31  A \c topoSetPointSource to convert \c pointZone(s) to a \c pointSet.
32 
33  Operands:
34  \table
35  Operand | Type | Location
36  input | pointZone(s) | $FOAM_CASE/constant/polyMesh/pointZones
37  output | pointSet | $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 pointSet;
47  action <action>;
48 
49  // Mandatory entries
50  source zoneToPoint;
51 
52  // Conditional mandatory entries
53  // Select either of the below
54 
55  // Option-1
56  zones
57  (
58  <pointZoneName0>
59  <pointZoneName1>
60  ...
61  );
62 
63  // Option-2
64  zone <pointZoneName>;
65  }
66  \endverbatim
67 
68  where the entries mean:
69  \table
70  Property | Description | Type | Req'd | Dflt
71  name | Name of pointSet | word | yes | -
72  type | Type name: pointSet | word | yes | -
73  action | Action applied on points - see below | word | yes | -
74  source | Source name: zoneToPoint | word | yes | -
75  \endtable
76 
77  Options for the \c action entry:
78  \verbatim
79  new | Create a new pointSet from selected points
80  add | Add selected points into this pointSet
81  subtract | Remove selected points from this pointSet
82  \endverbatim
83 
84  Options for the conditional mandatory entries:
85  \verbatim
86  Entry | Description | Type | Req'd | Dflt
87  zones | Names of input pointZones | wordList | cond'l | -
88  zone | Name of input pointZone | word | cond'l | -
89  \verbatim
90 
91 Note
92  The order of precedence among the conditional mandatory entries from the
93  highest to the lowest is \c zones, and \c zone.
94 
95 See also
96  - Foam::topoSetSource
97  - Foam::topoSetPointSource
98 
99 SourceFiles
100  zoneToPoint.C
101 
102 \*---------------------------------------------------------------------------*/
103 
104 #ifndef zoneToPoint_H
105 #define zoneToPoint_H
106 
107 #include "topoSetPointSource.H"
108 #include "wordRes.H"
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 namespace Foam
113 {
114 
115 /*---------------------------------------------------------------------------*\
116  Class zoneToPoint Declaration
117 \*---------------------------------------------------------------------------*/
118 
119 class zoneToPoint
120 :
121  public topoSetPointSource
122 {
123  // Private Data
124 
125  //- Add usage string
126  static addToUsageTable usage_;
127 
128  //- Matcher for zones
129  wordRes selectedZones_;
130 
131 
132  // Private Member Functions
133 
134  void combine(topoSet& set, const bool add) const;
135 
136 
137 public:
138 
139  //- Runtime type information
140  TypeName("zoneToPoint");
141 
142 
143  // Constructors
144 
145  //- Construct from components
146  zoneToPoint(const polyMesh& mesh, const wordRe& zoneName);
147 
148  //- Construct from dictionary
149  zoneToPoint(const polyMesh& mesh, const dictionary& dict);
150 
151  //- Construct from Istream
152  zoneToPoint(const polyMesh& mesh, Istream& is);
153 
154 
155  //- Destructor
156  virtual ~zoneToPoint() = default;
157 
158 
159  // Member Functions
160 
161  virtual void applyToSet
162  (
163  const topoSetSource::setAction action,
164  topoSet& set
165  ) const;
166 };
167 
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 } // End namespace Foam
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #endif
176 
177 // ************************************************************************* //
TypeName
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73
wordRes.H
Foam::topoSetSource::setAction
setAction
Enumeration defining the valid actions.
Definition: topoSetSource.H:99
Foam::ListListOps::combine
AccessType combine(const UList< T > &lists, AccessOp aop=accessOp< T >())
Combines sub-lists into a single list.
Definition: ListListOps.C:69
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::add
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Definition: FieldFieldFunctions.C:939
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
topoSetPointSource.H