Dopair subset vec
Vectorises the dopair_subset
function. A branched version has been implemented that only calls the vectorised version when two cells are face-on as the edge-on and corner-on cases run slower.
Edited by James Willis
Merge request reports
Activity
added 45 commits
-
52657340...5c87444c - 42 commits from branch
master
- 18f70b6e - Merge branch 'master' into dopair_subset_vec
- fd3fb786 - Forgot to rename function after merge with master.
- 98dd170d - Formatting.
Toggle commit list-
52657340...5c87444c - 42 commits from branch
It is now computed with a box wrapping:
def nearest(dx): if(dx > 0.5 * box_size): return dx - box_size elif(dx < -0.5 * box_size): return dx + box_size else: return dx ... dx = pi_pos[0][0] - pj_pos[0][0] dy = pi_pos[0][1] - pj_pos[0][1] dz = pi_pos[0][2] - pj_pos[0][2] # Correct for BCs dx = nearest(dx) dy = nearest(dy) dz = nearest(dz) r2 = dx*dx + dy*dy + dz*dz hig2 = hi*hi*kernel_gamma2 diff = abs(r2 - hig2) print "Particle {} is missing {}, hig2: {}, r2: {}, |r2 - hig2|: {}".format(pid,pjd,hig2, r2, diff) if diff < acc * hig2: print "Missing interaction due to precision issue will be ignored." else: return True
Also does it happen in the subset or in the normal pair? If in the subset is it because we shift by the cell where we process stuff and not necessarily by the cell where the particles are?
Edited by Matthieu SchallerAh! Ok, so that may explain the lack of accuracy there. You said the vectorized version actually finds that neighbour?
Edited by Matthieu Schaller
Please register or sign in to reply