48 void forEach(
const Pred& pred_r,
const OP& op_r)
50 constexpr std::size_t END = std::numeric_limits<std::size_t>::max();
62 for (
unsigned i=0; i<3; ++i) {
63 extentLLocal[i] = locDomain[i].first()*
hr_m[i]+
rmin_m[i];
64 extentRLocal[i] =
rmin_m[i]+(locDomain[i].last()+1)*
hr_m[i];
65 domainWidthLocal[i] = extentRLocal[i]-extentLLocal[i];
69 bucketsPerDim_m[i] = std::floor(domainWidthLocal[i]/pred_r.getRange(i));
87 std::vector<std::size_t> buckets(Nbucket);
89 std::vector<std::size_t> next(size);
91 std::fill(buckets.begin(), buckets.end(), END);
92 std::fill(next.begin(), next.end(), END);
101 int offset[14][3] = {{ 1, 1, 1}, { 0, 1, 1}, {-1, 1, 1},
102 { 1, 0, 1}, { 0, 0, 1}, {-1, 0, 1},
103 { 1,-1, 1}, { 0,-1, 1}, {-1,-1, 1},
104 { 1, 1, 0}, { 0, 1, 0}, {-1, 1, 0},
105 { 1, 0, 0}, { 0, 0, 0}};
108 for(std::size_t i = 0;i<size;++i)
111 if(bucketId >= Nbucket) {
112 std::cout <<
"Bucket with id: " << bucketId <<
" is wrong" << std::endl;
115 std::cout <<
"Particle coords: " <<
particles_mr.R[i] << std::endl;
116 std::cout <<
"rmin_m: " <<
rmin_m <<
"rmax_m: " <<
rmax_m << std::endl;
118 "Particle outside the local domain");
120 next[i] = buckets[bucketId];
121 buckets[bucketId] = i;
131 for (
unsigned n=0; n<neigh;++n){
132 int bxNeigh, byNeigh, bzNeigh;
134 bxNeigh = bx+offset[n][0];
135 byNeigh = by+offset[n][1];
136 bzNeigh = bz+offset[n][2];
142 unsigned bucketIdNeigh =
148 std::size_t i = buckets[bucketIdSelf];
155 j = buckets[bucketIdNeigh];
157 for (
int o=0;o<selfOffset;o++){
171 if (bucketIdSelf==bucketIdNeigh) {