pointDist.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) 2013-2026 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::pointDist
26 
27 Description
28  Calculates the distance to the specified sets of patch and pointZone points
29  or for all points
30 
31 SourceFiles
32  pointDist.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef pointDist_H
37 #define pointDist_H
38 
39 #include "pointFields.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 class pointMesh;
47 
48 /*---------------------------------------------------------------------------*\
49  Class pointDist Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class pointDist
53 :
54  public pointScalarField
55 {
56  // Private Data
57 
58  //- Reference to pointField
59  const pointField& points_;
60 
61  //- Set of start patch IDs for which the distance is 0
62  const labelHashSet startPatchIDs_;
63 
64  //- Set of start pointZone IDs for which the distance is 0
65  const labelHashSet startZoneIDs_;
66 
67  //- Set of end patch IDs for which the distance is great
68  const labelHashSet endPatchIDs_;
69 
70  //- Set of end pointZone IDs for which the distance is great
71  const labelHashSet endZoneIDs_;
72 
73  //- Maximum distance at which the point-edge wave is stopped
74  const scalar maxDist_;
75 
76 
77 public:
78 
79  // Constructors
80 
81  //- Construct from mesh and set of start patches
82  // for which the distance is 0 and points
83  pointDist
84  (
85  const pointMesh& pMesh,
86  const labelHashSet& startPatchIDs,
87  const pointField& points,
88  const scalar maxDist = rootVGreat
89  );
90 
91  //- Construct from mesh, set of start patches and pointZones
92  // for which the distance is 0
93  // and points
94  pointDist
95  (
96  const pointMesh& pMesh,
97  const labelHashSet& startPatchIDs,
98  const labelHashSet& startZoneIDs,
99  const labelHashSet& endPatchIDs,
100  const labelHashSet& endZoneIDs,
101  const pointField& points,
102  const scalar maxDist = rootVGreat
103  );
104 
105  //- Disallow default bitwise copy construction
106  pointDist(const pointDist&) = delete;
107 
108 
109  //- Destructor
110  virtual ~pointDist();
111 
112 
113  // Member Functions
114 
115  const pointScalarField& y() const
116  {
117  return *this;
118  }
119 
120  //- Correct for mesh geom/topo changes
121  void correct();
122 
123 
124  // Member Operators
125 
126  //- Disallow default bitwise assignment
127  void operator=(const pointDist&) = delete;
128 };
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace Foam
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #endif
138 
139 // ************************************************************************* //
Calculates the distance to the specified sets of patch and pointZone points or for all points.
Definition: pointDist.H:54
void operator=(const pointDist &)=delete
Disallow default bitwise assignment.
pointDist(const pointMesh &pMesh, const labelHashSet &startPatchIDs, const pointField &points, const scalar maxDist=rootVGreat)
Construct from mesh and set of start patches.
Definition: pointDist.C:34
const pointScalarField & y() const
Definition: pointDist.H:114
void correct()
Correct for mesh geom/topo changes.
Definition: pointDist.C:101
virtual ~pointDist()
Destructor.
Definition: pointDist.C:95
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:52
const pointField & points
Namespace for OpenFOAM.