triSurfaceRegionSearch.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-2019 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::triSurfaceRegionSearch
26 
27 Description
28  Helper class to search on triSurface. Creates an octree for each region of
29  the surface and only searches on the specified regions.
30 
31 SourceFiles
32  triSurfaceRegionSearch.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef triSurfaceRegionSearch_H
37 #define triSurfaceRegionSearch_H
38 
39 #include "pointField.H"
40 #include "pointIndexHit.H"
41 #include "triSurfaceSearch.H"
42 #include "labelledTri.H"
43 #include "IndirectList.H"
44 #include "PtrList.H"
45 #include "indexedOctree.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class triSurfaceRegionSearch Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 :
58  public triSurfaceSearch
59 {
60  // Private Typedefs
61 
64 
67 
69 
70 
71  // Private Data
72 
73  //- Surface is split into patches by region
74  mutable PtrList<indirectTriSurface> indirectRegionPatches_;
75 
76  //- Search tree for each region
77  mutable PtrList<treeType> treeByRegion_;
78 
79 
80 public:
81 
82  // Constructors
83 
84  //- Construct from surface. Holds reference to surface!
85  explicit triSurfaceRegionSearch(const triSurface&);
86 
87  //- Construct from surface and dictionary. Holds reference to surface!
89 
90  //- Disallow default bitwise copy construction
92 
93 
94  //- Destructor
96 
97  //- Clear storage
98  void clearOut();
99 
100 
101  // Member Functions
102 
103  // Access
104 
105  //- Demand driven construction of octree for each region.
106  // Currently creates a tree for each region; could optimise
107  // by only constructing trees when they are in regionIndices
108  const PtrList<treeType>& treeByRegion() const;
109 
110  // Query
111 
112  //- Find the nearest point on the surface out of the regions
113  // supplied in the list regionIndices. Ignores regions that are
114  // not specified
115  void findNearest
116  (
117  const pointField& samples,
118  const scalarField& nearestDistSqr,
119  const labelList& regionIndices,
120  List<pointIndexHit>& info
121  ) const;
122 
123 
124  // Member Operators
125 
126  //- Disallow default bitwise assignment
127  void operator=(const triSurfaceRegionSearch&) = delete;
128 };
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace Foam
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #endif
138 
139 // ************************************************************************* //
dictionary dict
void findNearest(const pointField &samples, const scalarField &nearestDistSqr, const labelList &regionIndices, List< pointIndexHit > &info) const
Find the nearest point on the surface out of the regions.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
triSurfaceRegionSearch(const triSurface &)
Construct from surface. Holds reference to surface!
Helper class to search on triSurface. Creates an octree for each region of the surface and only searc...
Helper class to search on triSurface.
scalarField samples(nIntervals, 0)
A list of faces which address into the list of points.
Encapsulation of data needed to search on PrimitivePatches.
const PtrList< treeType > & treeByRegion() const
Demand driven construction of octree for each region.
void operator=(const triSurfaceRegionSearch &)=delete
Disallow default bitwise assignment.
Non-pointer based hierarchical recursive searching.
Definition: treeDataEdge.H:47
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:70
Triangulated surface description with patch information.
Definition: triSurface.H:66
Namespace for OpenFOAM.