aboutsummaryrefslogtreecommitdiff
path: root/kernel.cl
diff options
context:
space:
mode:
authorAdrian Kummerlaender2020-03-23 16:01:56 +0100
committerAdrian Kummerlaender2020-03-23 16:01:56 +0100
commit908c1dfbd41a1bfe2210e3cfba0e41fda0940371 (patch)
treec90d614f3cb23cbe906e92b24107cd2234f32586 /kernel.cl
parent58678cfc3956ac5a1dbec91392b41b1b73a31463 (diff)
downloadboltzgas-908c1dfbd41a1bfe2210e3cfba0e41fda0940371.tar
boltzgas-908c1dfbd41a1bfe2210e3cfba0e41fda0940371.tar.gz
boltzgas-908c1dfbd41a1bfe2210e3cfba0e41fda0940371.tar.bz2
boltzgas-908c1dfbd41a1bfe2210e3cfba0e41fda0940371.tar.lz
boltzgas-908c1dfbd41a1bfe2210e3cfba0e41fda0940371.tar.xz
boltzgas-908c1dfbd41a1bfe2210e3cfba0e41fda0940371.tar.zst
boltzgas-908c1dfbd41a1bfe2210e3cfba0e41fda0940371.zip
Add some structure to view implementation
Diffstat (limited to 'kernel.cl')
-rw-r--r--kernel.cl20
1 files changed, 8 insertions, 12 deletions
diff --git a/kernel.cl b/kernel.cl
index 8bbe28a..0a8056b 100644
--- a/kernel.cl
+++ b/kernel.cl
@@ -108,22 +108,18 @@ __kernel void evolve(__global vec_t* pos_a,
pos_b[i] = p;
vel_b[i] = v;
} else {
- vec_t p_ = pos_a[jParticle];
- vec_t v_ = vel_a[jParticle];
-
- p += min2intersect * v;
- p_ += min2intersect * v_;
+ if (i < jParticle) {
+ vec_t p_ = pos_a[jParticle];
+ vec_t v_ = vel_a[jParticle];
- vec_t omega = normalize(p - p_);
+ p += min2intersect * v;
+ p_ += min2intersect * v_;
- while (dot(omega,omega) < 1.0) {
- omega *= 1.001;
- }
+ vec_t omega = normalize(p - p_);
- v -= dot(vel_a[i] - vel_a[jParticle], omega) * omega;
- v_ -= dot(vel_a[jParticle] - vel_a[i], omega) * omega;
+ v -= dot(vel_a[i] - vel_a[jParticle], omega) * omega;
+ v_ -= dot(vel_a[jParticle] - vel_a[i], omega) * omega;
- if (i < jParticle) {
p += (DELTA_T - min2intersect) * v;
p_ += (DELTA_T - min2intersect) * v_;