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-2021 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 
59  //- Name of set to use
60  word setName_;
61 
62  //- Coordinate that is nearest/on connected region
63  point nearPoint_;
64 
65  // Private Member Functions
66 
67  //- Walk edge-face-edge
68  void markZone
69  (
70  const indirectPrimitivePatch& patch,
71  const label proci,
72  const label facei,
73  const label zoneI,
75  ) const;
76 
77  void combine(topoSet& set, const bool add) const;
78 
79 public:
80 
81  //- Runtime type information
82  TypeName("regionToFace");
83 
84  // Constructors
85 
86  //- Construct from components
88  (
89  const polyMesh& mesh,
90  const word& setName,
91  const point& nearPoint
92  );
93 
94  //- Construct from dictionary
96  (
97  const polyMesh& mesh,
98  const dictionary& dict
99  );
100 
101 
102  //- Destructor
103  virtual ~regionToFace();
104 
105 
106  // Member Functions
107 
108  virtual sourceType setType() const
109  {
110  return FACESETSOURCE;
111  }
112 
113  virtual void applyToSet
114  (
115  const topoSetSource::setAction action,
116  topoSet&
117  ) const;
118 
119 };
120 
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 } // End namespace Foam
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 #endif
129 
130 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
A subset of mesh faces organised as a primitive patch.
Definition: faceZone.H:68
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
A topoSetSource to select faces belonging to topological connected region (that contains given point)
Definition: regionToFace.H:54
TypeName("regionToFace")
Runtime type information.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
Definition: regionToFace.C:190
virtual sourceType setType() const
Definition: regionToFace.H:107
regionToFace(const polyMesh &mesh, const word &setName, const point &nearPoint)
Construct from components.
Definition: regionToFace.C:157
virtual ~regionToFace()
Destructor.
Definition: regionToFace.C:183
Base class of a source for a topoSet.
Definition: topoSetSource.H:64
sourceType
Enumeration defining the types of sources.
Definition: topoSetSource.H:71
setAction
Enumeration defining the valid actions.
Definition: topoSetSource.H:83
const polyMesh & mesh() const
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:65
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
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
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dictionary dict