Skip to content
Snippets Groups Projects
Commit dd260c6a authored by James Willis's avatar James Willis
Browse files

Pad subpair cache.

parent 0f85b96d
No related branches found
No related tags found
1 merge request!480Dopair subset vec
......@@ -239,7 +239,7 @@ __attribute__((always_inline)) INLINE void cache_read_particles_subpair(
/* Shift the particles positions to a local frame so single precision can be
* used instead of double precision. */
for (int i = 0; i < ci->count; i++) {
const int idx = sort_i[i].i;
const int idx = i;//sort_i[i].i;
x[i] = (float)(parts[idx].x[0] - loc[0]);
y[i] = (float)(parts[idx].x[1] - loc[1]);
z[i] = (float)(parts[idx].x[2] - loc[2]);
......@@ -250,6 +250,23 @@ __attribute__((always_inline)) INLINE void cache_read_particles_subpair(
vz[i] = parts[idx].v[2];
}
const double max_dx = ci->dx_max_part;
const float pos_padded[3] = {-(2. * ci->width[0] + max_dx),
-(2. * ci->width[1] + max_dx),
-(2. * ci->width[2] + max_dx)};
const float h_padded = ci->parts[0].h;
for (int i = ci->count; i < ci->count + VEC_SIZE; i++) {
x[i] = pos_padded[0];
y[i] = pos_padded[1];
z[i] = pos_padded[2];
h[i] = h_padded;
m[i] = 1.f;
vx[i] = 1.f;
vy[i] = 1.f;
vz[i] = 1.f;
}
#endif
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment