11#ifndef HASH_PAIR_BUILDER_PARALLEL_H
12#define HASH_PAIR_BUILDER_PARALLEL_H
45 {
hr_m = p_r.get_hr(); }
47 template<
class Pred,
class OP>
48 void forEach(
const Pred& pred_r,
const OP& op_r)
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];
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;
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) {
194 bool isInside, isOutsideMin, isOutsideMax;
196 for (
unsigned d=0; d<3; ++d) {
205 loc[d] = ((int)isInside * indInside) + ((int)isOutsideMin * 0) + ((int)isOutsideMax * (
bucketsPerDim_m[d]-1));
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
PETE_TUTree< FnFloor, typename T::PETE_Expr_t > floor(const PETE_Expr< T > &l)
Inform & endl(Inform &inf)
std::size_t getBucketId(std::size_t i)
HashPairBuilderParallel(PBase &p_r, double gammaz)
Vektor< double, 3 > rmin_m
Vektor< int, 3 > bucketsPerDim_m
void forEach(const Pred &pred_r, const OP &op_r)
PBase::Position_t Position_t
Vektor< double, 3 > hChaining_m
Vektor< double, 3 > rmax_m