setAndPointToFaceZone.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) 2024-2025 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::setAndPointToFaceZone
26 
27 Description
28  A topoSetSource to select faces based on usage in a faceSet, where an
29  behind/inside point is used to orient the faces.
30 
31  The given point must be within the mesh, and the provided face set must
32  unambiguously separate cells that are connected to the point from those
33  that are not. This means that the set must be closed or must span the
34  entire width of the domain, from boundary to boundary.
35 
36  Whilst more restrictive than setToAndNormalToFaceZone, this method
37  allows sets to be reliably converted into zones even when it is not
38  possible to specify a normal direction that applies to all the faces;
39  for example a set representing a closed surface, or just one with
40  substantial variation in its surface normals.
41 
42 SourceFiles
43  setAndPointToFaceZone.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef setAndPointToFaceZone_H
48 #define setAndPointToFaceZone_H
49 
50 #include "topoSetSource.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 
57 /*---------------------------------------------------------------------------*\
58  Class setAndPointToFaceZone Declaration
59 \*---------------------------------------------------------------------------*/
60 
62 :
63  public topoSetSource
64 {
65  // Private Data
66 
67  //- Name of set to use
68  word setName_;
69 
70  //- Behind/inside point used to orient the faces
71  point point_;
72 
73 
74 public:
75 
76  //- Runtime type information
77  TypeName("setAndPointToFaceZone");
78 
79 
80  // Constructors
81 
82  //- Construct from components
84  (
85  const polyMesh& mesh,
86  const word& setName,
87  const vector& normal
88  );
89 
90  //- Construct from dictionary
92  (
93  const polyMesh& mesh,
94  const dictionary& dict
95  );
96 
97 
98  //- Destructor
99  virtual ~setAndPointToFaceZone();
100 
101 
102  // Member Functions
103 
104  virtual sourceType setType() const
105  {
106  return FACEZONESOURCE;
107  }
108 
109  virtual void applyToSet
110  (
111  const topoSetSource::setAction action,
112  topoSet&
113  ) const;
114 };
115 
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 } // End namespace Foam
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 #endif
124 
125 // ************************************************************************* //
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
A topoSetSource to select faces based on usage in a faceSet, where an behind/inside point is used to ...
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
virtual sourceType setType() const
virtual ~setAndPointToFaceZone()
Destructor.
setAndPointToFaceZone(const polyMesh &mesh, const word &setName, const vector &normal)
Construct from components.
TypeName("setAndPointToFaceZone")
Runtime type information.
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:61
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
dictionary dict