patchPatchDist.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) 2011-2013 OpenFOAM Foundation
9  Copyright (C) 2019 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::patchPatchDist
29 
30 Description
31  Like wallDist but calculates on a patch the distance to nearest neighbouring
32  patches. Uses PatchEdgeFaceWave to do actual calculation.
33 
34 SourceFiles
35  patchPatchDist.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef patchPatchDist_H
40 #define patchPatchDist_H
41 
42 #include "scalarField.H"
43 #include "HashSet.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 //class polyMesh;
51 class polyPatch;
52 
53 /*---------------------------------------------------------------------------*\
54  Class patchPatchDist Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class patchPatchDist
58 :
59  public scalarField
60 {
61  // Private Member Data
62 
63  //- Patch to operate on
64  const polyPatch& patch_;
65 
66  //- Patches to determine the distance to
67  const labelHashSet nbrPatchIDs_;
68 
69  //- Number of unset faces.
70  label nUnset_;
71 
72 public:
73 
74  // Constructors
75 
76  //- Construct from patch and neighbour patches.
78  (
79  const polyPatch& pp,
80  const labelHashSet& nbrPatchIDs
81  );
82 
83 
84  //- Destructor
85  virtual ~patchPatchDist() = default;
86 
87 
88  // Member Functions
89 
90  const scalarField& y() const
91  {
92  return *this;
93  }
94 
95  label nUnset() const
96  {
97  return nUnset_;
98  }
99 
100  //- Correct for mesh geom/topo changes
101  virtual void correct();
102 };
103 
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 } // End namespace Foam
108 
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 
111 #endif
112 
113 // ************************************************************************* //
scalarField.H
Foam::HashSet< label, Hash< label > >
Foam::patchPatchDist::correct
virtual void correct()
Correct for mesh geom/topo changes.
Definition: patchPatchDist.C:53
Foam::patchPatchDist
Like wallDist but calculates on a patch the distance to nearest neighbouring patches....
Definition: patchPatchDist.H:56
Foam::Field< scalar >
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::patchPatchDist::patchPatchDist
patchPatchDist(const polyPatch &pp, const labelHashSet &nbrPatchIDs)
Construct from patch and neighbour patches.
Definition: patchPatchDist.C:38
HashSet.H
Foam::patchPatchDist::y
const scalarField & y() const
Definition: patchPatchDist.H:89
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::patchPatchDist::~patchPatchDist
virtual ~patchPatchDist()=default
Destructor.
Foam::patchPatchDist::nUnset
label nUnset() const
Definition: patchPatchDist.H:94