All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
regionToFace.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::regionToFace
26 
27 Description
28  A topoSetSource to select faces belonging to topological connected region
29  (that contains given point)
30 
31 SourceFiles
32  regionToFace.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef regionToFace_H
37 #define regionToFace_H
38 
39 #include "topoSetSource.H"
40 #include "PackedBoolList.H"
41 #include "indirectPrimitivePatch.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class regionToFace Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class regionToFace
53 :
54  public topoSetSource
55 {
56  // Private Data
57 
58  //- Add usage string
59  static addToUsageTable usage_;
60 
61  //- Name of set to use
62  word setName_;
63 
64  //- Coordinate that is nearest/on connected region
65  point nearPoint_;
66 
67  // Private Member Functions
68 
69  //- Walk edge-face-edge
70  void markZone
71  (
72  const indirectPrimitivePatch& patch,
73  const label proci,
74  const label facei,
75  const label zoneI,
77  ) const;
78 
79  void combine(topoSet& set, const bool add) const;
80 
81 public:
82 
83  //- Runtime type information
84  TypeName("regionToFace");
85 
86  // Constructors
87 
88  //- Construct from components
90  (
91  const polyMesh& mesh,
92  const word& setName,
93  const point& nearPoint
94  );
95 
96  //- Construct from dictionary
98  (
99  const polyMesh& mesh,
100  const dictionary& dict
101  );
102 
103  //- Construct from Istream
105  (
106  const polyMesh& mesh,
107  Istream&
108  );
109 
110 
111  //- Destructor
112  virtual ~regionToFace();
113 
114 
115  // Member Functions
117  virtual sourceType setType() const
118  {
119  return FACESETSOURCE;
120  }
121 
122  virtual void applyToSet
123  (
124  const topoSetSource::setAction action,
125  topoSet&
126  ) const;
127 
128 };
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace Foam
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #endif
138 
139 // ************************************************************************* //
dictionary dict
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
Definition: regionToFace.C:221
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
Base class of a source for a topoSet.
Definition: topoSetSource.H:63
const polyMesh & mesh() const
virtual sourceType setType() const
Definition: regionToFace.H:116
A list of faces which address into the list of points.
A class for handling words, derived from string.
Definition: word.H:59
setAction
Enumeration defining the valid actions.
Definition: topoSetSource.H:82
virtual ~regionToFace()
Destructor.
Definition: regionToFace.C:214
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:61
regionToFace(const polyMesh &mesh, const word &setName, const point &nearPoint)
Construct from components.
Definition: regionToFace.C:176
sourceType
Enumeration defining the types of sources.
Definition: topoSetSource.H:70
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
A subset of mesh faces organised as a primitive patch.
Definition: faceZone.H:64
TypeName("regionToFace")
Runtime type information.
Namespace for OpenFOAM.
A topoSetSource to select faces belonging to topological connected region (that contains given point)...
Definition: regionToFace.H:51