ComputationalRadiationPhysics / isaac

In Situ Animation of Accelerated Computations :microscope:
http://ComputationalRadiationPhysics.github.io/isaac/
GNU Lesser General Public License v3.0
25 stars 15 forks source link

GUI: update interval fails for "with add" #99

Open PrometheusPi opened 5 years ago

PrometheusPi commented 5 years ago

I tested isaac using the default KHI example (with gamma=3).

In order to plot the particle momentum according to the min max range, I used the "With add" option to automatically optimize the range. However, the new range did not stick to the plotable range of [0-1] but went outside the plotable range. There seems to be an issue with this new range. I will provide screen shots below.

PrometheusPi commented 5 years ago

Range set manual:

grafik

grafik (not ideal setting - since it is slightly below zero)

Range set automatically: starting from mul(1,0,0) (only x-component of momentum) then pressing (with "With add") grafik

grafik

starting from idem (also x-component of momentum only) then pressing (with "With add") it looks better but does not give useful ranges grafik

grafik

PrometheusPi commented 5 years ago

One part of the issue seems to come from that fact that adding add(0.5) on a vector quantity actually means add( 0.5, 0.5, 0.5), which of course, if you just rescaled values with mul(x) to ( [-1,+1], ~0, ~0 ) - that you now end up with ( [-0.5,+1.5], ~0.5, ~0.5 ) - which is exactly what one gets one optimizing automatically with "With add".

PrometheusPi commented 5 years ago

The relevant code is here: https://github.com/ComputationalRadiationPhysics/isaac/blob/8cf6133034b0601f49a13f19621b130b1ac2bd30/client/js/isaac/interface/visualisation.js#L363-L374