patchToCell.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 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::patchToCell
28 
29 Description
30  A topoSetCellSource to select cells associated with patches.
31 
32  \heading Dictionary parameters
33  \table
34  Property | Description | Required | Default
35  patches | The patch names or regexs | possibly |
36  patch | The patch name or regex | possibly |
37  \endtable
38 
39 Note
40  Must specify "patches" or "patch" (highest to lowest precedence).
41 
42 SourceFiles
43  patchToCell.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef patchToCell_H
48 #define patchToCell_H
49 
50 #include "topoSetCellSource.H"
51 #include "wordRes.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class patchToCell Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class patchToCell
63 :
64  public topoSetCellSource
65 {
66  // Private Data
67 
68  //- Add usage string
69  static addToUsageTable usage_;
70 
71  //- Matcher for patches
72  wordRes selectedPatches_;
73 
74 
75  // Private Member Functions
76 
77  void combine(topoSet& set, const bool add) const;
78 
79 
80 public:
81 
82  //- Runtime type information
83  TypeName("patchToCell");
84 
85  // Constructors
86 
87  //- Construct from components
88  patchToCell(const polyMesh& mesh, const wordRe& patchName);
89 
90  //- Construct from dictionary
91  patchToCell(const polyMesh& mesh, const dictionary& dict);
92 
93  //- Construct from Istream
94  patchToCell(const polyMesh& mesh, Istream& is);
95 
96 
97  //- Destructor
98  virtual ~patchToCell() = default;
99 
100 
101  // Member Functions
102 
103  virtual void applyToSet
104  (
105  const topoSetSource::setAction action,
106  topoSet& set
107  ) const;
108 
109 };
110 
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 } // End namespace Foam
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 #endif
119 
120 // ************************************************************************* //
wordRes.H
Foam::patchToCell::patchToCell
patchToCell(const polyMesh &mesh, const wordRe &patchName)
Construct from components.
Definition: patchToCell.C:112
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::patchToCell::TypeName
TypeName("patchToCell")
Runtime type information.
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::patchToCell::applyToSet
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: patchToCell.C:155
Foam::topoSet
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:66
Foam::patchToCell
A topoSetCellSource to select cells associated with patches.
Definition: patchToCell.H:76
topoSetCellSource.H
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::patchToCell::~patchToCell
virtual ~patchToCell()=default
Destructor.
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