diff options
author | Adrian Kummerlaender | 2020-03-27 22:04:16 +0100 |
---|---|---|
committer | Adrian Kummerlaender | 2020-03-27 22:04:16 +0100 |
commit | 5e99925cd258ff68f1da7ce0bdb823efe785d8de (patch) | |
tree | 1794eec3f8980fc036a01f9bf856c089bf7dc344 /zero_velocities.py | |
parent | 1d0639e33296f4cdc6f635732202ef05c2c6f81a (diff) | |
download | boltzgas-5e99925cd258ff68f1da7ce0bdb823efe785d8de.tar boltzgas-5e99925cd258ff68f1da7ce0bdb823efe785d8de.tar.gz boltzgas-5e99925cd258ff68f1da7ce0bdb823efe785d8de.tar.bz2 boltzgas-5e99925cd258ff68f1da7ce0bdb823efe785d8de.tar.lz boltzgas-5e99925cd258ff68f1da7ce0bdb823efe785d8de.tar.xz boltzgas-5e99925cd258ff68f1da7ce0bdb823efe785d8de.tar.zst boltzgas-5e99925cd258ff68f1da7ce0bdb823efe785d8de.zip |
Reenable 2D support
Diffstat (limited to 'zero_velocities.py')
-rw-r--r-- | zero_velocities.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/zero_velocities.py b/zero_velocities.py index d0de774..26a21f9 100644 --- a/zero_velocities.py +++ b/zero_velocities.py @@ -4,21 +4,23 @@ from boltzgas import HardSphereSetup, HardSphereSimulation from boltzgas.initial_condition import grid_of_random_velocity_particles from boltzgas.visual import VelocityHistogram, WireBox -grid_width = 10 -radius = 0.005 +dimension = 2 +grid_width = 30 +radius = 0.002 char_u = 1120 -position, velocity = grid_of_random_velocity_particles(grid_width, radius, char_u) +position, velocity = grid_of_random_velocity_particles(dimension, grid_width, radius, char_u) velocity[:,:] = 0 velocity[0,0] = 5*char_u velocity[0,1] = 4*char_u -velocity[0,2] = 3*char_u +if dimension == 3: + velocity[0,2] = 3*char_u config = HardSphereSetup(radius, char_u, position, velocity) gas = HardSphereSimulation(config, opengl = True, t_scale = 0.5) histogram = VelocityHistogram(gas, [1.1,0], [1,1]) -instruments = [ WireBox(0,1,0,1,0,1), histogram ] +instruments = [ WireBox(0,1,0,1,0,dimension == 3 if 1 else 0), histogram ] boltzgas.visualizer.simulate(config, gas, instruments) |