meshBoundarySearch.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) 2011-2025 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::meshBoundarySearch
26 
27 Description
28  Mesh object that implements searches within the local boundary faces
29 
30 SourceFiles
31  meshBoundarySearch.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef meshBoundarySearch_H
36 #define meshBoundarySearch_H
37 
38 #include "DemandDrivenMeshObject.H"
39 #include "polyMesh.H"
40 #include "treeDataFace.H"
41 #include "indexedOctree.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class meshBoundarySearch Declaration
50 \*---------------------------------------------------------------------------*/
51 
53 :
55  <
56  polyMesh,
57  DeletableMeshObject,
58  meshBoundarySearch
59  >
60 {
61  // Private Classes
62 
63  // Intersection operation class that checks previous successful hits so
64  // that they are not duplicated
66 
67 
68  // Private Data
69 
70  //- Boundary tree
71  const indexedOctree<treeDataFace> boundaryTree_;
72 
73 
74 public:
75 
76  //- Run-time type information
77  TypeName("meshBoundarySearch");
78 
79 
80  // Constructors
81 
82  //- Construct from mesh
84 
85  //- Disallow default bitwise copy construction
86  meshBoundarySearch(const meshBoundarySearch&) = delete;
87 
88 
89  //- Destructor
90  virtual ~meshBoundarySearch();
91 
92 
93  // Member Functions
94 
95  // Access
96 
97  //- Access the boundary tree
98  inline const indexedOctree<treeDataFace>& boundaryTree() const
99  {
100  return boundaryTree_;
101  }
102 
103 
104  // Queries
105 
106  //- Find the boundary face with centre closest to the given point
107  label findNearestBoundaryFace(const point& p) const;
108 
109  //- Find the first intersection of the boundary with the line
110  // defined by the given start and end points
112  (
113  const point& pStart,
114  const point& pEnd
115  ) const;
116 
117  //- Find all intersections of the boundary with the line
118  // defined by the given start and end points
120  (
121  const point& pStart,
122  const point& pEnd
123  ) const;
124 
125  //- Determine whether the given point is inside the mesh boundary
126  bool isInside(const point&) const;
127 
128 
129  // Member Operators
130 
131  //- Disallow default bitwise assignment
132  void operator=(const meshBoundarySearch&) = delete;
133 };
134 
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 } // End namespace Foam
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
Templated abstract base-class for demand-driven mesh objects used to automate their allocation to the...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:91
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
Definition: PointIndexHit.H:54
Non-pointer based hierarchical recursive searching.
Definition: indexedOctree.H:72
Mesh object that implements searches within the local boundary faces.
TypeName("meshBoundarySearch")
Run-time type information.
pointIndexHit intersection(const point &pStart, const point &pEnd) const
Find the first intersection of the boundary with the line.
label findNearestBoundaryFace(const point &p) const
Find the boundary face with centre closest to the given point.
bool isInside(const point &) const
Determine whether the given point is inside the mesh boundary.
List< pointIndexHit > intersections(const point &pStart, const point &pEnd) const
Find all intersections of the boundary with the line.
void operator=(const meshBoundarySearch &)=delete
Disallow default bitwise assignment.
const indexedOctree< treeDataFace > & boundaryTree() const
Access the boundary tree.
virtual ~meshBoundarySearch()
Destructor.
meshBoundarySearch(const polyMesh &mesh)
Construct from mesh.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:78
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
volScalarField & p