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-2024 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 Member Data
57 
58  //- Reference to pointField
59  const pointField& points_;
60 
61  //- Set of patch IDs
62  const labelHashSet patchIndices_;
63 
64  //- Set of pointZone IDs for which the distance is 0
65  const labelHashSet zoneIndices_;
66 
67  //- Maximum distance at which the point-edge wave is stopped
68  const scalar maxDist_;
69 
70 
71 public:
72 
73  // Constructors
74 
75  //- Construct from mesh and set of patches and points
76  pointDist
77  (
78  const pointMesh& pMesh,
79  const labelHashSet& patchIDs,
80  const pointField& points,
81  const scalar maxDist = rootVGreat
82  );
83 
84  //- Construct from mesh, set of patches,
85  // set of pointZones for which the distance is 0
86  // and points
87  pointDist
88  (
89  const pointMesh& pMesh,
90  const labelHashSet& patchIDs,
91  const labelHashSet& zoneIDs,
92  const pointField& points,
93  const scalar maxDist = rootVGreat
94  );
95 
96  //- Disallow default bitwise copy construction
97  pointDist(const pointDist&) = delete;
98 
99 
100  //- Destructor
101  virtual ~pointDist();
102 
103 
104  // Member Functions
105 
106  const pointScalarField& y() const
107  {
108  return *this;
109  }
110 
111  //- Correct for mesh geom/topo changes
112  void correct();
113 
114 
115  // Member Operators
116 
117  //- Disallow default bitwise assignment
118  void operator=(const pointDist&) = delete;
119 };
120 
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 } // End namespace Foam
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 #endif
129 
130 // ************************************************************************* //
Calculates the distance to the specified sets of patch and pointZone points or for all points.
Definition: pointDist.H:54
pointDist(const pointMesh &pMesh, const labelHashSet &patchIDs, const pointField &points, const scalar maxDist=rootVGreat)
Construct from mesh and set of patches and points.
Definition: pointDist.C:34
void operator=(const pointDist &)=delete
Disallow default bitwise assignment.
const pointScalarField & y() const
Definition: pointDist.H:105
void correct()
Correct for mesh geom/topo changes.
Definition: pointDist.C:97
virtual ~pointDist()
Destructor.
Definition: pointDist.C:91
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:53
const pointField & points
Namespace for OpenFOAM.