Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ScalFMM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
solverstack
ScalFMM
Commits
66ef3bb3
Commit
66ef3bb3
authored
Apr 10, 2017
by
Quentin Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate FNode::getDepth in favor of FNode::getLevel
Better consistency with rest of code.
parent
b198b960
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
22 deletions
+34
-22
Src/Adaptive/FAdaptiveSequential.hpp
Src/Adaptive/FAdaptiveSequential.hpp
+2
-2
Src/Adaptive/FAdaptiveTask.hpp
Src/Adaptive/FAdaptiveTask.hpp
+2
-2
Src/Adaptive/FNode.hpp
Src/Adaptive/FNode.hpp
+28
-16
Tests/noDist/Adaptive/test_FAdaptiveSequential.cpp
Tests/noDist/Adaptive/test_FAdaptiveSequential.cpp
+2
-2
No files found.
Src/Adaptive/FAdaptiveSequential.hpp
View file @
66ef3bb3
...
...
@@ -407,10 +407,10 @@ public:
* ancestor at the highest one's level is used.
*/
int
compute_box_offset_index
(
node_t
*
node
,
node_t
*
other_node
,
const
std
::
size_t
n
)
{
while
(
node
->
get
Depth
()
>
other_node
->
getDepth
())
{
while
(
node
->
get
Level
()
>
other_node
->
getLevel
())
{
node
=
node
->
getParent
();
}
while
(
node
->
get
Depth
()
<
other_node
->
getDepth
())
{
while
(
node
->
get
Level
()
<
other_node
->
getLevel
())
{
other_node
=
other_node
->
getParent
();
}
...
...
Src/Adaptive/FAdaptiveTask.hpp
View file @
66ef3bb3
...
...
@@ -1139,10 +1139,10 @@ public:
* ancestor at the highest one's level is used.
*/
int
compute_box_offset_index
(
node_t
*
node
,
node_t
*
other_node
,
const
std
::
size_t
n
)
{
while
(
node
->
get
Depth
()
>
other_node
->
getDepth
())
{
while
(
node
->
get
Level
()
>
other_node
->
getLevel
())
{
node
=
node
->
getParent
();
}
while
(
node
->
get
Depth
()
<
other_node
->
getDepth
())
{
while
(
node
->
get
Level
()
<
other_node
->
getLevel
())
{
other_node
=
other_node
->
getParent
();
}
...
...
Src/Adaptive/FNode.hpp
View file @
66ef3bb3
...
...
@@ -221,6 +221,13 @@ public:
static_assert
(
models_symbolic_data
<
symbolic_data_t
>::
value
,
"The symbolic_data_t type does not model the required symbolic data interface."
);
using
level_t
=
typename
std
::
remove_reference
<
decltype
(
std
::
declval
<
symbolic_data_t
>
().
getLevel
())
>::
type
;
using
morton_index_t
=
typename
std
::
remove_reference
<
decltype
(
std
::
declval
<
symbolic_data_t
>
().
getMortonIndex
())
>::
type
;
private:
friend
struct
scalfmm
::
tests
::
test_Node
;
...
...
@@ -272,7 +279,7 @@ public:
_parent
(
&
parent
),
_box
(
parent
.
getBox
().
center
(),
parent
.
getBox
().
corner
(
child_index
)
),
_tree
(
parent
.
_tree
),
_symbolic_data
{
static_cast
<
int
>
(
parent
.
get
Depth
()
+
1
),
(
parent
.
getIndex
()
<<
Dim
)
+
child_index
}
_symbolic_data
{
static_cast
<
int
>
(
parent
.
get
Level
()
+
1
),
(
parent
.
getIndex
()
<<
Dim
)
+
child_index
}
{
if
(
child_index
>=
child_count
)
{
throw
std
::
invalid_argument
(
std
::
string
(
"Wrong child index in node contructor: got "
)
...
...
@@ -390,8 +397,13 @@ public:
}
/// Depth accessor
std
::
size_t
getDepth
()
const
noexcept
{
return
_symbolic_data
.
depth
;
[[
gnu
::
deprecated
(
"Use getLevel for interface consistency."
)]]
level_t
getDepth
()
const
noexcept
{
return
_symbolic_data
.
getLevel
();
}
/// Level accessor
level_t
getLevel
()
const
noexcept
{
return
_symbolic_data
.
getLevel
();
}
/// Morton index accessor
...
...
@@ -677,7 +689,7 @@ public:
*/
bool
operator
==
(
const
FNode
&
other
)
const
{
return
other
.
getParent
()
==
getParent
()
&&
other
.
get
Depth
()
==
getDepth
()
&&
other
.
get
Level
()
==
getLevel
()
&&
other
.
getIndex
()
==
getIndex
();
}
...
...
@@ -703,7 +715,7 @@ private:
data
->
setMortonIndex
(
node
->
getIndex
());
FTreeCoordinate
coord
(
node
->
getIndex
());
data
->
setCoordinate
(
coord
);
data
->
setLevel
(
node
->
get
Depth
());
data
->
setLevel
(
node
->
get
Level
());
}
/**
...
...
@@ -739,8 +751,8 @@ private:
*/
void
update_tree_height
()
{
assert
(
is_leaf
()
==
true
);
if
(
get
Depth
()
+
1
>
getTree
().
height
())
getTree
().
set_height
(
get
Depth
()
+
1
);
if
(
get
Level
()
+
1
>
getTree
().
height
())
getTree
().
set_height
(
get
Level
()
+
1
);
}
/**
...
...
@@ -766,7 +778,7 @@ private:
// Remove this node from tree leaf list
getTree
().
leaves
().
erase
(
this
);
// Create the children, add them to tree leaf list
FNode
*
tmp
=
this
->
getTree
().
node_memory_manager
.
provide
(
this
->
get
Depth
()
+
1
,
child_count
);
FNode
*
tmp
=
this
->
getTree
().
node_memory_manager
.
provide
(
this
->
get
Level
()
+
1
,
child_count
);
for
(
FNode
*&
child
:
getChildren
())
{
child
=
new
(
tmp
+
idx
)
FNode
(
*
this
,
idx
);
getTree
().
leaves
().
insert
(
child
);
...
...
@@ -805,7 +817,7 @@ private:
void
split
()
{
assert
(
this
->
is_leaf
());
if
(
get
Depth
()
+
1
>
getTree
().
max_height
())
{
if
(
get
Level
()
+
1
>
getTree
().
max_height
())
{
// TODO: log that there were too many particles
return
;
}
...
...
@@ -823,13 +835,13 @@ private:
// Adjacent to child
child
->
U
.
insert
(
u_item
);
u_item
->
U
.
insert
(
child
);
}
else
if
(
u_item
->
get
Depth
()
<
child
->
getDepth
())
{
}
else
if
(
u_item
->
get
Level
()
<
child
->
getLevel
())
{
// Adjacent to parent (this) but not to child
child
->
X
.
insert
(
u_item
);
u_item
->
W
.
insert
(
child
);
}
else
{
// u_item->get
Depth() >= child->getDepth
()
}
else
{
// u_item->get
Level() >= child->getLevel
()
// Find ancestor of u_item that is adjacent to child
while
(
u_item
->
get
Depth
()
>
child
->
getDepth
())
{
while
(
u_item
->
get
Level
()
>
child
->
getLevel
())
{
if
(
child
->
is_adjacent
(
u_item
->
getParent
()))
{
// Parent is adjacent -> W list
child
->
W
.
insert
(
u_item
);
...
...
@@ -839,7 +851,7 @@ private:
u_item
=
u_item
->
getParent
();
}
}
if
(
u_item
->
get
Depth
()
==
child
->
getDepth
())
{
if
(
u_item
->
get
Level
()
==
child
->
getLevel
())
{
// No adjacent ancestor -> add a neighbour
child
->
V
.
insert
(
u_item
);
u_item
->
V
.
insert
(
child
);
...
...
@@ -851,12 +863,12 @@ private:
for
(
FNode
*
w_item
:
this
->
W
)
{
// Find first ancestor of w_item that is adjacent to child
// not needed, done in U list treatment, only check parent
if
(
child
->
get
Depth
()
<
w_item
->
getDepth
())
{
if
(
child
->
get
Level
()
<
w_item
->
getLevel
())
{
if
(
child
->
is_adjacent
(
w_item
->
getParent
()))
{
child
->
W
.
insert
(
w_item
);
w_item
->
X
.
insert
(
child
);
}
}
else
if
(
child
->
get
Depth
()
==
w_item
->
getDepth
())
{
}
else
if
(
child
->
get
Level
()
==
w_item
->
getLevel
())
{
// No adjacent ancestor -> add a neighbour
child
->
V
.
insert
(
w_item
);
w_item
->
V
.
insert
(
child
);
...
...
@@ -995,7 +1007,7 @@ private:
// Node data and recurrence
auto
index_width
=
std
::
setw
(
static_cast
<
int
>
(
std
::
log10
(
1
<<
(
Dim
*
(
this
->
get
Depth
()
+
1
)))));
std
::
log10
(
1
<<
(
Dim
*
(
this
->
get
Level
()
+
1
)))));
if
(
!
this
->
is_leaf
())
{
// Internal node
os
<<
"node "
<<
index_width
<<
this
->
getIndex
()
<<
":
\n
"
;
...
...
Tests/noDist/Adaptive/test_FAdaptiveSequential.cpp
View file @
66ef3bb3
...
...
@@ -32,7 +32,7 @@
template
<
typename
node_t
>
std
::
size_t
expected_P2P
(
node_t
*
node
)
{
std
::
size_t
index
=
node
->
getIndex
();
std
::
size_t
depth
=
node
->
get
Depth
();
std
::
size_t
depth
=
node
->
get
Level
();
int
min
=
0
;
int
max
=
(
int
)
std
::
pow
(
2
,
depth
);
...
...
@@ -68,7 +68,7 @@ std::size_t expected_M2M(node_t* node) {
template
<
typename
node_t
>
std
::
size_t
expected_M2L
(
node_t
*
node
,
bool
v
=
false
)
{
std
::
size_t
index
=
node
->
getIndex
();
std
::
size_t
depth
=
node
->
get
Depth
();
std
::
size_t
depth
=
node
->
get
Level
();
int
min
=
0
;
int
max
=
(
int
)
std
::
pow
(
2
,
depth
);
...
...
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