From 6bed7f80ea8e67c388f1c52a60237e7ceb8c274e Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Tue, 17 Sep 2019 21:25:27 +0200 Subject: Extract indicators, drawing of geometric primitives --- template/kernel.mako | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'template/kernel.mako') 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; -- cgit v1.2.3