zoneToCell.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 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::zoneToCell
29 
30 Description
31  A topoSetCellSource to select cells based on one or more cellZones.
32 
33  \heading Dictionary parameters
34  \table
35  Property | Description | Required | Default
36  zones | The cell zone names or regexs | possibly |
37  zone | The cell zone name or regex | possibly |
38  name | Older specification for 'zone' | no |
39  \endtable
40 
41 Note
42  Must specify "zones", "zone" or "name" (highest to lowest precedence).
43 
44 SourceFiles
45  zoneToCell.C
46 
47 \*---------------------------------------------------------------------------*/
48 
49 #ifndef zoneToCell_H
50 #define zoneToCell_H
51 
52 #include "topoSetCellSource.H"
53 #include "wordRes.H"
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace Foam
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class zoneToCell Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 class zoneToCell
65 :
66  public topoSetCellSource
67 {
68 
69  // Private data
70 
71  //- Add usage string
72  static addToUsageTable usage_;
73 
74  //- Matcher for zones
75  wordRes selectedZones_;
76 
77 
78  // Private Member Functions
79 
80  void combine(topoSet& set, const bool add) const;
81 
82 
83 public:
84 
85  //- Runtime type information
86  TypeName("zoneToCell");
87 
88  // Constructors
89 
90  //- Construct from components
91  zoneToCell(const polyMesh& mesh, const wordRe& zoneName);
92 
93  //- Construct from dictionary
94  zoneToCell(const polyMesh& mesh, const dictionary& dict);
95 
96  //- Construct from Istream
97  zoneToCell(const polyMesh& mesh, Istream& is);
98 
99 
100  //- Destructor
101  virtual ~zoneToCell() = default;
102 
103 
104  // Member Functions
105 
106  virtual void applyToSet
107  (
108  const topoSetSource::setAction action,
109  topoSet& set
110  ) const;
111 
112 };
113 
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 } // End namespace Foam
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 #endif
122 
123 // ************************************************************************* //
wordRes.H
Foam::zoneToCell::zoneToCell
zoneToCell(const polyMesh &mesh, const wordRe &zoneName)
Construct from components.
Definition: zoneToCell.C:113
Foam::zoneToCell
A topoSetCellSource to select cells based on one or more cellZones.
Definition: zoneToCell.H:83
Foam::combine
Definition: FaceCellWave.C:56
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::wordRe
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
Definition: wordRe.H:72
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::zoneToCell::TypeName
TypeName("zoneToCell")
Runtime type information.
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::zoneToCell::~zoneToCell
virtual ~zoneToCell()=default
Destructor.
Foam::topoSet
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:66
topoSetCellSource.H
Foam::zoneToCell::applyToSet
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: zoneToCell.C:156
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::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
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::topoSetCellSource
Base class of a topoSet source for selecting cells.
Definition: topoSetCellSource.H:50
Foam::wordRes
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:51