aboutsummaryrefslogtreecommitdiff
path: root/template/kernel.mako
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-09-17 21:25:27 +0200
committerAdrian Kummerlaender2019-09-17 21:25:27 +0200
commit6bed7f80ea8e67c388f1c52a60237e7ceb8c274e (patch)
treec19e163ad6dffa35c9b0a11bfdf3d767c112f51e /template/kernel.mako
parent6123c8a37ca74b319a005d9dcbed5a2c05fc2ecc (diff)
downloadsymlbm_playground-6bed7f80ea8e67c388f1c52a60237e7ceb8c274e.tar
symlbm_playground-6bed7f80ea8e67c388f1c52a60237e7ceb8c274e.tar.gz
symlbm_playground-6bed7f80ea8e67c388f1c52a60237e7ceb8c274e.tar.bz2
symlbm_playground-6bed7f80ea8e67c388f1c52a60237e7ceb8c274e.tar.lz
symlbm_playground-6bed7f80ea8e67c388f1c52a60237e7ceb8c274e.tar.xz
symlbm_playground-6bed7f80ea8e67c388f1c52a60237e7ceb8c274e.tar.zst
symlbm_playground-6bed7f80ea8e67c388f1c52a60237e7ceb8c274e.zip
Extract indicators, drawing of geometric primitives
Diffstat (limited to 'template/kernel.mako')
-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;