aboutsummaryrefslogtreecommitdiff
path: root/template
diff options
context:
space:
mode:
Diffstat (limited to 'template')
-rw-r--r--template/kernel.mako10
1 files changed, 7 insertions, 3 deletions
diff --git a/template/kernel.mako b/template/kernel.mako
index 529eb30..a57c2ec 100644
--- a/template/kernel.mako
+++ b/template/kernel.mako
@@ -157,18 +157,22 @@ __kernel void update_particles(__global __read_only float4* moments,
const float4 moment = moments[gid];
- if (material[gid] == 1 && particle.w < 1.0) {
+ if (material[gid] == 1) {
particle.x += moment.y;
particle.y += moment.z;
% if descriptor.d == 2:
particle.w += min(particle.x, particle.y) * aging;
% elif descriptor.d == 3:
particle.z += moment.w;
- particle.w += min(min(particle.x, particle.y), particle.z) * aging;
+ float dy = (particle.y-${geometry.size_y/2.0});
+ float dz = (particle.z-${geometry.size_z/2.0});
+ dy *= dy;
+ dz *= dz;
+ particle.w = 10.0*sqrt(moment.y*moment.y+moment.z*moment.z+moment.w*moment.w);
% endif
} else {
particle.xyz = init_particles[pid].xyz;
- particle.w = particle.w-1.0;
+ particle.w = 0.0;
}
particles[pid] = particle;