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