OpenFOAM
v2312
The open source CFD toolbox
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
-------------------------------------------------------------------------------
11
License
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
27
Class
28
Foam::triSurfaceRegionSearch
29
30
Description
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
34
SourceFiles
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
52
namespace
Foam
53
{
54
55
/*---------------------------------------------------------------------------*\
56
Class triSurfaceRegionSearch Declaration
57
\*---------------------------------------------------------------------------*/
58
59
class
triSurfaceRegionSearch
60
:
61
public
triSurfaceSearch
62
{
63
// Private Typedefs
64
65
typedef
PrimitivePatch<IndirectList<labelledTri>
,
const
pointField
&>
66
indirectTriSurface
;
67
68
typedef
treeDataPrimitivePatch<indirectTriSurface>
69
treeDataIndirectTriSurface
;
70
71
typedef
indexedOctree<treeDataIndirectTriSurface>
treeType
;
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
86
triSurfaceRegionSearch
(
const
triSurfaceRegionSearch
&) =
delete
;
87
88
//- No copy assignment
89
void
operator=(
const
triSurfaceRegionSearch
&) =
delete
;
90
91
92
public
:
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!
100
triSurfaceRegionSearch
(
const
triSurface
&,
const
dictionary
&
dict
);
101
102
103
//- Destructor
104
~triSurfaceRegionSearch
();
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,
129
List<pointIndexHit>
& info
130
)
const
;
131
};
132
133
134
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135
136
}
// End namespace Foam
137
138
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139
140
#endif
141
142
// ************************************************************************* //
dict
dictionary dict
Definition:
searchingEngine.H:11
Foam::triSurfaceRegionSearch::clearOut
void clearOut()
Clear storage.
Definition:
triSurfaceRegionSearch.C:57
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 a number of values (eg...
Definition:
dictionary.H:129
Foam::List< label >
samples
scalarField samples(nIntervals, Zero)
Foam::triSurfaceRegionSearch
Helper class to search on triSurface. Creates an octree for each region of the surface and only searc...
Definition:
triSurfaceRegionSearch.H:54
Foam::triSurfaceRegionSearch::~triSurfaceRegionSearch
~triSurfaceRegionSearch()
Destructor.
Definition:
triSurfaceRegionSearch.C:51
triSurfaceSearch.H
Foam::triSurfaceSearch
Helper class to search on triSurface.
Definition:
triSurfaceSearch.H:54
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition:
PrimitivePatch.H:70
Foam::Field< vector >
Foam::treeDataPrimitivePatch
Encapsulation of data needed to search on PrimitivePatches.
Definition:
treeDataPrimitivePatch.H:59
indexedOctree.H
pointIndexHit.H
Foam::triSurfaceRegionSearch::treeByRegion
const PtrList< treeType > & treeByRegion() const
Demand driven construction of octree for each region.
Definition:
triSurfaceRegionSearch.C:67
PtrList.H
Foam::indexedOctree
Non-pointer based hierarchical recursive searching.
Definition:
treeDataPrimitivePatch.H:44
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Definition:
List.H:55
labelledTri.H
Foam::triSurface
Triangulated surface description with patch information.
Definition:
triSurface.H:71
Foam
Namespace for OpenFOAM.
Definition:
atmBoundaryLayer.C:26
IndirectList.H
src
meshTools
triSurface
triSurfaceSearch
triSurfaceRegionSearch.H
Generated by
1.8.14