pointToFace.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-2012 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::pointToFace
29 
30 Description
31  A topoSetFaceSource to select faces based on use of points.
32 
33  \heading Dictionary parameters
34  \table
35  Property | Description | Required | Default
36  sets | The pointSet names to use | possibly |
37  set | The pointSet name to use | possibly |
38  option | Selection type (all/any/edge) | yes |
39  \endtable
40 
41 Note
42  Must specify "sets" or "set" (highest to lowest precedence).
43 
44 SourceFiles
45  pointToFace.C
46 
47 \*---------------------------------------------------------------------------*/
48 
49 #ifndef pointToFace_H
50 #define pointToFace_H
51 
52 #include "topoSetFaceSource.H"
53 #include "Enum.H"
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace Foam
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class pointToFace Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 class pointToFace
65 :
66  public topoSetFaceSource
67 {
68 
69 public:
70 
71  //- Enumeration defining the valid options
72  enum pointAction
73  {
74  ANY,
75  ALL,
76  EDGE
77  };
78 
79 
80 private:
81 
82  //- Add usage string
83  static addToUsageTable usage_;
84 
85  static const Enum<pointAction> pointActionNames_;
86 
87  //- Names of sets to use
88  wordList names_;
89 
90  //- Option
91  pointAction option_;
92 
93 
94  // Private Member Functions
95 
96  //- Depending on face to cell option add to or delete from cellSet.
97  void combine(topoSet& set, const bool add, const word& setName) const;
98 
99 
100 public:
101 
102  //- Runtime type information
103  TypeName("pointToFace");
104 
105  // Constructors
106 
107  //- Construct from components
109  (
110  const polyMesh& mesh,
111  const word& setName,
112  const pointAction option
113  );
114 
115  //- Construct from dictionary
116  pointToFace(const polyMesh& mesh, const dictionary& dict);
117 
118  //- Construct from Istream
119  pointToFace(const polyMesh& mesh, Istream& is);
120 
121 
122  //- Destructor
123  virtual ~pointToFace() = default;
124 
125 
126  // Member Functions
127 
128  virtual void applyToSet
129  (
130  const topoSetSource::setAction action,
131  topoSet& set
132  ) const;
133 
134 };
135 
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 } // End namespace Foam
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 #endif
144 
145 // ************************************************************************* //
Foam::Enum< pointAction >
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::combine
Definition: FaceCellWave.C:56
Foam::topoSetSource::addToUsageTable
Class with constructor to add usage string to table.
Definition: topoSetSource.H:124
Foam::topoSetSource::setAction
setAction
Enumeration defining the valid actions.
Definition: topoSetSource.H:99
Foam::topoSetFaceSource
Base class of a topoSet source for selecting faces.
Definition: topoSetFaceSource.H:50
Foam::pointToFace::pointAction
pointAction
Enumeration defining the valid options.
Definition: pointToFace.H:91
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::pointToFace::pointToFace
pointToFace(const polyMesh &mesh, const word &setName, const pointAction option)
Construct from components.
Definition: pointToFace.C:165
Foam::pointToFace::applyToSet
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: pointToFace.C:211
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::pointToFace::EDGE
Definition: pointToFace.H:95
Foam::pointToFace::TypeName
TypeName("pointToFace")
Runtime type information.
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::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::pointToFace::ALL
Definition: pointToFace.H:94
Foam::List< word >
Foam::pointToFace
A topoSetFaceSource to select faces based on use of points.
Definition: pointToFace.H:83
topoSetFaceSource.H
Foam::pointToFace::ANY
Definition: pointToFace.H:93
Foam::pointToFace::~pointToFace
virtual ~pointToFace()=default
Destructor.
Enum.H