pointPatchDist.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013-2016 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::pointPatchDist
29 
30 Description
31  Calculation of distance to nearest patch for all points
32 
33 SourceFiles
34  pointPatchDist.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef pointPatchDist_H
39 #define pointPatchDist_H
40 
41 #include "pointFields.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward Declarations
49 class pointMesh;
50 
51 /*---------------------------------------------------------------------------*\
52  Class pointPatchDist Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class pointPatchDist
56 :
57  public pointScalarField
58 {
59 private:
60 
61  // Private Member Data
62 
63  //- Reference to pointField
64  const pointField& points_;
65 
66  //- Set of patch IDs
67  const labelHashSet patchIDs_;
68 
69  //- Number of unset points
70  label nUnset_;
71 
72 
73  // Private Member Functions
74 
75  //- No copy construct
76  pointPatchDist(const pointPatchDist&) = delete;
77 
78  //- No copy assignment
79  void operator=(const pointPatchDist&) = delete;
80 
81 
82 public:
83 
84  // Constructors
85 
86  //- Construct from mesh and set of patches
88  (
89  const pointMesh& pMesh,
90  const labelHashSet& patchIDs,
91  const pointField& points
92  );
93 
94 
95  //- Destructor
96  virtual ~pointPatchDist() = default;
97 
98 
99  // Member Functions
100 
101  const pointScalarField& y() const
102  {
103  return *this;
104  }
105 
106  label nUnset() const
107  {
108  return nUnset_;
109  }
110 
111  //- Correct for mesh geom/topo changes
112  void correct();
113 };
114 
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 } // End namespace Foam
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 #endif
123 
124 // ************************************************************************* //
Foam::pointPatchDist::y
const pointScalarField & y() const
Definition: pointPatchDist.H:100
Foam::pointPatchDist::correct
void correct()
Correct for mesh geom/topo changes.
Definition: pointPatchDist.C:64
Foam::HashSet< label, Hash< label > >
Foam::pointPatchDist::nUnset
label nUnset() const
Definition: pointPatchDist.H:105
Foam::Field< vector >
Foam::pointPatchDist::~pointPatchDist
virtual ~pointPatchDist()=default
Destructor.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::pointMesh
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:51
Foam::pointPatchDist
Calculation of distance to nearest patch for all points.
Definition: pointPatchDist.H:54
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::GeometricField< scalar, pointPatchField, pointMesh >
pointFields.H