exactPatchDistMethod.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) 2018-2019 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::patchDistMethods::exact
28 
29 Description
30  Calculation of exact distance to nearest patch for all cells and
31  boundary by constructing a search tree for all patch faces.
32 
33 See also
34  Foam::patchDistMethod::meshWave
35  Foam::wallDist
36 
37 SourceFiles
38  exactPatchDistMethod.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef exactPatchDistMethod_H
43 #define exactPatchDistMethod_H
44 
45 #include "patchDistMethod.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 class distributedTriSurfaceMesh;
53 
54 namespace patchDistMethods
55 {
56 
57 /*---------------------------------------------------------------------------*\
58  Class exact Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 class exact
62 :
63  public patchDistMethod
64 {
65  // Private Member Data
66 
67  //- Cache surface+searching of patch
68  mutable autoPtr<distributedTriSurfaceMesh> patchSurfPtr_;
69 
70 
71  // Private Member Functions
72 
73  const distributedTriSurfaceMesh& patchSurface() const;
74 
75  //- No copy construct
76  exact(const exact&) = delete;
77 
78  //- No copy assignment
79  void operator=(const exact&) = delete;
80 
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("exactDistance");
86 
87 
88  // Constructors
89 
90  //- Construct from coefficients dictionary, mesh
91  // and fixed-value patch set
92  exact
93  (
94  const dictionary& dict,
95  const fvMesh& mesh,
96  const labelHashSet& patchIDs
97  );
98 
99  //- Construct from mesh and fixed-value patch set
100  exact
101  (
102  const fvMesh& mesh,
103  const labelHashSet& patchIDs
104  );
105 
106 
107  // Member Functions
108 
109  //- Update cached geometry when the mesh moves
110  virtual bool movePoints()
111  {
112  // ? Reconstruct patch surface?
113  //patchSurfPtr_.clear();
114  return true;
115  }
116 
117  //- Update cached topology and geometry when the mesh changes
118  virtual void updateMesh(const mapPolyMesh&)
119  {
120  // ? Reconstruct patch surface?
121  //patchSurfPtr_.clear();
122  }
123 
124  //- Correct the given distance-to-patch field
125  virtual bool correct(volScalarField& y);
126 
127  //- Correct the given distance-to-patch and normal-to-patch fields
128  virtual bool correct(volScalarField& y, volVectorField& n);
129 };
130 
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 } // End namespace patchDistMethods
135 } // End namespace Foam
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #endif
140 
141 // ************************************************************************* //
Foam::patchDistMethods::exact
Calculation of exact distance to nearest patch for all cells and boundary by constructing a search tr...
Definition: exactPatchDistMethod.H:60
Foam::patchDistMethods::exact::movePoints
virtual bool movePoints()
Update cached geometry when the mesh moves.
Definition: exactPatchDistMethod.H:109
Foam::HashSet< label, Hash< label > >
patchDistMethod.H
n
label n
Definition: TABSMDCalcMethod2.H:31
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::patchDistMethods::exact::correct
virtual bool correct(volScalarField &y)
Correct the given distance-to-patch field.
Definition: exactPatchDistMethod.C:150
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::patchDistMethod
Specialisation of patchDist for wall distance calculation.
Definition: patchDistMethod.H:59
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::patchDistMethods::exact::TypeName
TypeName("exactDistance")
Runtime type information.
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::distributedTriSurfaceMesh
IOoject and searching on distributed triSurface. All processor hold (possibly overlapping) part of th...
Definition: distributedTriSurfaceMesh.H:85
Foam::patchDistMethods::exact::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Update cached topology and geometry when the mesh changes.
Definition: exactPatchDistMethod.H:117
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:161
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::patchDistMethod::patchIDs
const labelHashSet & patchIDs() const
Return the patchIDs.
Definition: patchDistMethod.H:143
y
scalar y
Definition: LISASMDCalcMethod1.H:14