Commit 746cd69d authored by Quentin Khan's avatar Quentin Khan

FAdaptiveSequential: create a sorted P2P adjacent list for each call

parent 09196ac7
#ifndef SCALFMM_SEQUENTIAL_ALGO_HPP_
#define SCALFMM_SEQUENTIAL_ALGO_HPP_
#include <algorithm>
#include <cmath> // Used to round box differences
#include <functional>
......@@ -223,8 +224,19 @@ public:
if(u_item == leaf) {
continue;
}
u_item_indices.push_back(compute_box_offset_index(leaf, u_item, 1));
u_item_source_particle_containers.push_back(u_item->getParticleContainer());
//u_item_source_particle_containers.push_back(u_item->getParticleContainer());
}
std::sort(u_item_indices.begin(), u_item_indices.end());
for(int idx : u_item_indices) {
for(node_t* u_item : leaf->U) {
if(idx == compute_box_offset_index(leaf, u_item, 1)) {
u_item_source_particle_containers.push_back(u_item->getParticleContainer());
}
}
}
_kernel.P2P(
......@@ -233,8 +245,7 @@ public:
leaf_target_particle_container,
u_item_source_particle_containers.data(),
u_item_indices.data(),
static_cast<int>(leaf->U.size()-1),
leaf->getData()
static_cast<int>(u_item_source_particle_containers.size())
);
}
}
......
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