OpenFOAM
10
The OpenFOAM Foundation
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
56
class
triSurfaceRegionSearch
57
:
58
public
triSurfaceSearch
59
{
60
// Private Typedefs
61
62
typedef
PrimitivePatch<IndirectList<labelledTri>
,
const
pointField
&>
63
indirectTriSurface
;
64
65
typedef
treeDataPrimitivePatch<indirectTriSurface>
66
treeDataIndirectTriSurface
;
67
68
typedef
indexedOctree<treeDataIndirectTriSurface>
treeType
;
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!
88
triSurfaceRegionSearch
(
const
triSurface
&,
const
dictionary
&
dict
);
89
90
//- Disallow default bitwise copy construction
91
triSurfaceRegionSearch
(
const
triSurfaceRegionSearch
&) =
delete
;
92
93
94
//- Destructor
95
~triSurfaceRegionSearch
();
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
// ************************************************************************* //
dict
dictionary dict
Definition:
searchingEngine.H:14
Foam::triSurfaceRegionSearch::clearOut
void clearOut()
Clear storage.
Definition:
triSurfaceRegionSearch.C:61
pointField.H
Foam::triSurfaceRegionSearch::findNearest
void findNearest(const pointField &samples, const scalarField &nearestDistSqr, const labelList ®ionIndices, List< pointIndexHit > &info) const
Find the nearest point on the surface out of the regions.
Definition:
triSurfaceRegionSearch.C:180
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition:
dictionary.H:156
Foam::triSurfaceRegionSearch::triSurfaceRegionSearch
triSurfaceRegionSearch(const triSurface &)
Construct from surface. Holds reference to surface!
Definition:
triSurfaceRegionSearch.C:33
Foam::List< label >
Foam::triSurfaceRegionSearch
Helper class to search on triSurface. Creates an octree for each region of the surface and only searc...
Definition:
triSurfaceRegionSearch.H:55
Foam::triSurfaceRegionSearch::~triSurfaceRegionSearch
~triSurfaceRegionSearch()
Destructor.
Definition:
triSurfaceRegionSearch.C:55
triSurfaceSearch.H
Foam::triSurfaceSearch
Helper class to search on triSurface.
Definition:
triSurfaceSearch.H:55
samples
scalarField samples(nIntervals, 0)
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition:
PrimitivePatch.H:81
Foam::Field< vector >
Foam::treeDataPrimitivePatch
Encapsulation of data needed to search on PrimitivePatches.
Definition:
treeDataPrimitivePatch.H:61
indexedOctree.H
pointIndexHit.H
Foam::triSurfaceRegionSearch::treeByRegion
const PtrList< treeType > & treeByRegion() const
Demand driven construction of octree for each region.
Definition:
triSurfaceRegionSearch.C:71
PtrList.H
Foam::triSurfaceRegionSearch::operator=
void operator=(const triSurfaceRegionSearch &)=delete
Disallow default bitwise assignment.
Foam::indexedOctree
Non-pointer based hierarchical recursive searching.
Definition:
treeDataEdge.H:47
Foam::PtrList
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
labelledTri.H
Foam::triSurface
Triangulated surface description with patch information.
Definition:
triSurface.H:66
Foam
Namespace for OpenFOAM.
Definition:
atmBoundaryLayer.H:213
IndirectList.H
src
meshTools
triSurface
triSurfaceSearch
triSurfaceRegionSearch.H
Generated by
1.8.13