Commit 03c429c9 authored by Quentin Khan's avatar Quentin Khan

FAdaptiveSequential: add check in P2L and M2P to discard empty leaves

parent 77e7f096
......@@ -168,9 +168,16 @@ public:
// P2L
void x_list_step() {
for(node_t& node : _tree.in_order_walk()) {
for(node_t* x_item : node.X) {
_kernel.P2L(node.getData(), x_item->getParticleContainer());
/* NOTE: the X list and W list are complementary: if A is in X(B) then B
* is in W(A).
*
* We loop over the leaves first to detect the empty ones early on.
*/
for(node_t* node : _tree.leaves()) {
if(node->getParticleContainer()->size() > 0) {
for(node_t* w_item : node->W) {
_kernel.P2L(w_item->getData(), node->getParticleContainer());
}
}
}
}
......@@ -190,9 +197,11 @@ public:
// M2P
void w_list_step() {
for(node_t& node : _tree.in_order_walk()) {
for(node_t* w_item : node.W) {
_kernel.M2P(w_item->getData(), node.getParticleContainer());
for(node_t* node : _tree.leaves()) {
if(node->getParticleContainer()->size() > 0) {
for(node_t* w_item : node->W) {
_kernel.M2P(w_item->getData(), node->getParticleContainer());
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment