Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
solverstack
ScalFMM
Commits
a302ae08
Commit
a302ae08
authored
Nov 18, 2019
by
ESTERIE Pierre
Browse files
Fix issue
#22
parent
51bffbd4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Src/Containers/FOctree.hpp
View file @
a302ae08
...
...
@@ -738,7 +738,7 @@ public:
CellClass
*
getCell
(
const
MortonIndex
inIndex
,
const
int
inLevel
)
const
{
SubOctreeTypesConst
workingTree
;
workingTree
.
tree
=
this
->
root
;
const
MortonIndex
treeSubLeafMask
=
~
(
~
0
x00
LL
<<
(
3
*
workingTree
.
tree
->
getSubOctreeHeight
()
));
const
MortonIndex
treeSubLeafMask
=
~
(
~
0
U
LL
<<
(
3
*
workingTree
.
tree
->
getSubOctreeHeight
()
));
// Find the suboctree a the correct level
while
(
inLevel
>=
workingTree
.
tree
->
getSubOctreeHeight
()
+
workingTree
.
tree
->
getSubOctreePosition
())
{
...
...
@@ -750,7 +750,7 @@ public:
}
// compute correct index in the array
const
MortonIndex
treeLeafMask
=
~
(
~
0
x00
LL
<<
(
3
*
(
inLevel
+
1
-
workingTree
.
tree
->
getSubOctreePosition
())
));
const
MortonIndex
treeLeafMask
=
~
(
~
0
U
LL
<<
(
3
*
(
inLevel
+
1
-
workingTree
.
tree
->
getSubOctreePosition
())
));
return
workingTree
.
tree
->
cellsAt
(
inLevel
-
workingTree
.
tree
->
getSubOctreePosition
())[
treeLeafMask
&
inIndex
];
}
...
...
@@ -817,7 +817,7 @@ public:
SubOctreeTypesConst
workingTree
;
workingTree
.
tree
=
this
->
root
;
const
MortonIndex
treeMiddleMask
=
~
(
~
0
x00
LL
<<
(
3
*
workingTree
.
tree
->
getSubOctreeHeight
()
));
const
MortonIndex
treeMiddleMask
=
~
(
~
0
U
LL
<<
(
3
*
workingTree
.
tree
->
getSubOctreeHeight
()
));
// Find the suboctree a the correct level
while
(
inLevel
>=
workingTree
.
tree
->
getSubOctreeHeight
()
+
workingTree
.
tree
->
getSubOctreePosition
())
{
...
...
@@ -830,12 +830,12 @@ public:
// Be sure there is a parent allocated
const
int
levelInTree
=
inLevel
-
workingTree
.
tree
->
getSubOctreePosition
();
if
(
levelInTree
&&
!
workingTree
.
tree
->
cellsAt
(
levelInTree
-
1
)[
~
(
~
0
x00
LL
<<
(
3
*
levelInTree
))
&
(
inIndex
>>
3
)]){
if
(
levelInTree
&&
!
workingTree
.
tree
->
cellsAt
(
levelInTree
-
1
)[
~
(
~
0
U
LL
<<
(
3
*
levelInTree
))
&
(
inIndex
>>
3
)]){
return
nullptr
;
}
// compute correct index in the array and return the @ in array
const
MortonIndex
treeLeafMask
=
~
(
~
0
x00
LL
<<
(
3
*
(
levelInTree
+
1
)
));
const
MortonIndex
treeLeafMask
=
~
(
~
0
U
LL
<<
(
3
*
(
levelInTree
+
1
)
));
return
&
workingTree
.
tree
->
cellsAt
(
levelInTree
)[
treeLeafMask
&
inIndex
];
}
...
...
@@ -1298,7 +1298,7 @@ public:
ContainerClass
*
getLeafSrc
(
const
MortonIndex
inIndex
){
SubOctreeTypes
workingTree
;
workingTree
.
tree
=
this
->
root
;
const
MortonIndex
treeSubLeafMask
=
~
(
~
0
x00
LL
<<
(
3
*
workingTree
.
tree
->
getSubOctreeHeight
()
));
const
MortonIndex
treeSubLeafMask
=
~
(
~
0
U
LL
<<
(
3
*
workingTree
.
tree
->
getSubOctreeHeight
()
));
// Find the suboctree a the correct level
while
(
leafIndex
>=
workingTree
.
tree
->
getSubOctreeHeight
()
+
workingTree
.
tree
->
getSubOctreePosition
())
{
...
...
@@ -1310,7 +1310,7 @@ public:
}
// compute correct index in the array
const
MortonIndex
treeLeafMask
=
~
(
~
0
x00
LL
<<
(
3
*
(
leafIndex
+
1
-
workingTree
.
tree
->
getSubOctreePosition
())
));
const
MortonIndex
treeLeafMask
=
~
(
~
0
U
LL
<<
(
3
*
(
leafIndex
+
1
-
workingTree
.
tree
->
getSubOctreePosition
())
));
return
workingTree
.
leafTree
->
getLeafSrc
(
int
(
treeLeafMask
&
inIndex
));
}
...
...
Src/Containers/FSubOctree.hpp
View file @
a302ae08
...
...
@@ -65,7 +65,7 @@ protected:
// Remove right useless part - used by child
const
MortonIndex
fullIndex
=
index
>>
(
3
*
(
inTreeHeight
-
(
this
->
subOctreeHeight
+
this
->
subOctreePosition
)
)
);
// Remove left extra data part - used by parent
const
MortonIndex
treeLeafMask
=
~
(
~
0
x00
LL
<<
(
3
*
this
->
subOctreeHeight
));
const
MortonIndex
treeLeafMask
=
~
(
~
0
U
LL
<<
(
3
*
this
->
subOctreeHeight
));
return
treeLeafMask
&
fullIndex
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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