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