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,2024 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 Usage
34 
35  \begin{verbatim}
36  wallDist
37  {
38  method exactDistance;
39 
40  // Optional entries (currently for distributedTriSurfaceMesh)
41  exactDistanceCoeffs
42  {
43  // Optional decomposition method. If not supplied will use the
44  // system/decomposeParDict.
45  method hierarchical;
46  numberOfSubdomains 8;
47  n (2 2 2);
48 
49  // (not)add fill-in triangles
50  decomposeUsingBbs false;
51  }
52  }
53  \end{verbatim}
54 
55 See also
56  Foam::patchDistMethod::meshWave
57  Foam::wallDist
58  Foam::distributedTriSurfaceMesh
59 
60 SourceFiles
61  exactPatchDistMethod.C
62 
63 \*---------------------------------------------------------------------------*/
64 
65 #ifndef exactPatchDistMethod_H
66 #define exactPatchDistMethod_H
67 
68 #include "patchDistMethod.H"
69 
70 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 
72 namespace Foam
73 {
74 
75 class distributedTriSurfaceMesh;
76 
77 namespace patchDistMethods
78 {
79 
80 /*---------------------------------------------------------------------------*\
81  Class exact Declaration
82 \*---------------------------------------------------------------------------*/
83 
84 class exact
85 :
86  public patchDistMethod
87 {
88  // Private Member Data
89 
90  //- Dictionary contents from the dictionary constructor
91  mutable dictionary dict_;
92 
93  //- Cache surface+searching of patch
94  mutable autoPtr<distributedTriSurfaceMesh> patchSurfPtr_;
95 
96 
97  // Private Member Functions
98 
99  const distributedTriSurfaceMesh& patchSurface() const;
100 
101  //- No copy construct
102  exact(const exact&) = delete;
103 
104  //- No copy assignment
105  void operator=(const exact&) = delete;
106 
107 
108 public:
109 
110  //- Runtime type information
111  TypeName("exactDistance");
112 
113 
114  // Constructors
115 
116  //- Construct from coefficients dictionary, mesh
117  // and fixed-value patch set
118  exact
119  (
120  const dictionary& dict,
121  const fvMesh& mesh,
122  const labelHashSet& patchIDs
123  );
124 
125  //- Construct from mesh and fixed-value patch set
126  exact
127  (
128  const fvMesh& mesh,
129  const labelHashSet& patchIDs
130  );
131 
132 
133  // Member Functions
134 
135  //- Update cached geometry when the mesh moves
136  virtual bool movePoints()
137  {
138  // ? Reconstruct patch surface?
139  //patchSurfPtr_.clear();
140  return true;
141  }
142 
143  //- Update cached topology and geometry when the mesh changes
144  virtual void updateMesh(const mapPolyMesh&)
145  {
146  // ? Reconstruct patch surface?
147  //patchSurfPtr_.clear();
148  }
149 
150  //- Correct the given distance-to-patch field
151  virtual bool correct(volScalarField& y);
152 
153  //- Correct the given distance-to-patch and normal-to-patch fields
154  virtual bool correct(volScalarField& y, volVectorField& n);
155 };
156 
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 } // End namespace patchDistMethods
161 } // End namespace Foam
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #endif
166 
167 // ************************************************************************* //
dictionary dict
virtual bool movePoints()
Update cached geometry when the mesh moves.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
scalar y
dynamicFvMesh & mesh
TypeName("exactDistance")
Runtime type information.
IOoject and searching on distributed triSurface. All processor hold (possibly overlapping) part of th...
const labelHashSet & patchIDs() const
Return the patchIDs.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
virtual bool correct(volScalarField &y)
Correct the given distance-to-patch field.
label n
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
Specialisation of patchDist for wall distance calculation.
Calculation of exact distance to nearest patch for all cells and boundary by constructing a search tr...
virtual void updateMesh(const mapPolyMesh &)
Update cached topology and geometry when the mesh changes.
Namespace for OpenFOAM.