setAndNormalToFaceZone.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) 2013 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::setAndNormalToFaceZone
29 
30 Description
31  A topoSetSource to select faces based on usage in a faceSet, where the
32  normal vector is used to orient the faces.
33 
34  \heading Dictionary parameters
35  \table
36  Property | Description | Required | Default
37  faceSet | Name of input faceSet | yes |
38  normal | The normal vector for orientation | yes |
39  \endtable
40 
41 SourceFiles
42  setAndNormalToFaceZone.C
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef setAndNormalToFaceZone_H
47 #define setAndNormalToFaceZone_H
48 
49 #include "topoSetSource.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class setAndNormalToFaceZone Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 class setAndNormalToFaceZone
61 :
62  public topoSetSource
63 {
64  // Private data
65 
66  //- Add usage string
67  static addToUsageTable usage_;
68 
69  //- Name of set to use
70  word setName_;
71 
72  //- Normal used to orient the faces
73  vector normal_;
74 
75 
76 public:
77 
78  //- Runtime type information
79  TypeName("setAndNormalToFaceZone");
80 
81  // Constructors
82 
83  //- Construct from components
85  (
86  const polyMesh& mesh,
87  const word& setName,
88  const vector& normal
89  );
90 
91  //- Construct from dictionary
93 
94  //- Construct from Istream
96 
97 
98  //- Destructor
99  virtual ~setAndNormalToFaceZone() = default;
100 
101 
102  // Member Functions
103 
104  //- The source category is a faceZone
105  virtual topoSetSource::sourceType setType() const
106  {
107  return FACEZONE_SOURCE;
108  }
109 
110  virtual void applyToSet
111  (
112  const topoSetSource::setAction action,
113  topoSet& set
114  ) const;
115 };
116 
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 } // End namespace Foam
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 #endif
125 
126 // ************************************************************************* //
Foam::topoSetSource::sourceType
sourceType
Enumeration defining the types of sources.
Definition: topoSetSource.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::setAndNormalToFaceZone::setType
virtual topoSetSource::sourceType setType() const
The source category is a faceZone.
Definition: setAndNormalToFaceZone.H:119
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::setAndNormalToFaceZone::TypeName
TypeName("setAndNormalToFaceZone")
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::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
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
Foam::setAndNormalToFaceZone::applyToSet
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: setAndNormalToFaceZone.C:94
Foam::topoSetSource::FACEZONE_SOURCE
Faces as zone.
Definition: topoSetSource.H:87
Foam::setAndNormalToFaceZone
A topoSetSource to select faces based on usage in a faceSet, where the normal vector is used to orien...
Definition: setAndNormalToFaceZone.H:74
Foam::setAndNormalToFaceZone::setAndNormalToFaceZone
setAndNormalToFaceZone(const polyMesh &mesh, const word &setName, const vector &normal)
Construct from components.
Definition: setAndNormalToFaceZone.C:55
Foam::Vector< scalar >
topoSetSource.H
Foam::setAndNormalToFaceZone::~setAndNormalToFaceZone
virtual ~setAndNormalToFaceZone()=default
Destructor.