Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
5790fbe2
Commit
5790fbe2
authored
Mar 16, 2021
by
Andrew Heather
Committed by
Mark Olesen
Apr 14, 2021
Browse files
BUG: AABBTree - corrected addressing. Fixes
#2028
parent
10b9467f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/meshTools/AABBTree/AABBTree.C
View file @
5790fbe2
...
...
@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015 OpenFOAM Foundation
Copyright (C) 2016-201
7
OpenCFD Ltd.
Copyright (C) 2016-20
2
1 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -396,22 +396,43 @@ Foam::AABBTree<Type>::AABBTree
// transfer flattened tree to persistent storage
DynamicList
<
treeBoundBox
>
boundBoxes
(
2
*
bbs
.
size
());
DynamicList
<
labelList
>
addressing
(
2
*
addr
.
size
());
forAll
(
nodes
,
nodeI
)
{
if
(
nodes
[
nodeI
].
first
()
<
0
)
{
boundBoxes
.
append
(
bbs
[
nodeI
].
first
());
addressing
.
append
(
addr
[
nodeI
+
1
]);
addressing
.
append
(
addr
[
-
(
nodes
[
nodeI
].
first
()
+
1
)
]);
}
if
(
nodes
[
nodeI
].
second
()
<
0
)
{
boundBoxes
.
append
(
bbs
[
nodeI
].
second
());
addressing
.
append
(
addr
[
nodeI
+
1
]);
addressing
.
append
(
addr
[
-
(
nodes
[
nodeI
].
second
()
+
1
)
]);
}
}
boundBoxes_
.
transfer
(
boundBoxes
);
addressing_
.
transfer
(
addressing
);
if
(
0
)
{
bitSet
checked
(
objects
.
size
());
for
(
const
auto
&
box
:
addressing_
)
{
for
(
const
auto
&
id
:
box
)
{
checked
.
set
(
id
);
}
}
const
label
unsetSize
=
checked
.
count
(
false
);
if
(
unsetSize
)
{
Info
<<
"*** Problem: IDs not set: "
<<
unsetSize
<<
endl
;
}
}
}
...
...
src/meshTools/AABBTree/AABBTree.H
View file @
5790fbe2
...
...
@@ -142,8 +142,7 @@ public:
AABBTree
();
//- Construct from components
// equalBinSize: divide into equal number of elements or
// equal span
// equalBinSize: divide into equal number of elements or equal span
AABBTree
(
const
UList
<
Type
>&
objects
,
...
...
@@ -171,7 +170,7 @@ public:
bool
pointInside
(
const
point
&
pt
)
const
;
//- Determine whether a bounding box overlaps the tree bounding
//
boxes
//
-
boxes
bool
overlaps
(
const
boundBox
&
bbIn
)
const
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment