Skip to content

Commit

Permalink
python: Fix OpenGL visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
jngrad committed Mar 18, 2022
1 parent 78a22db commit 6ff54a3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion samples/lj-demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def main_loop():
new_box = np.ones(3) * controls.volume**(1. / 3.)
if np.any(np.array(system.box_l) != new_box):
for p in system.part:
p.pos *= new_box / system.box_l[0]
p.pos = p.pos * new_box / system.box_l[0]
print("volume changed")
system.force_cap = lj_cap
system.box_l = new_box
Expand Down
23 changes: 9 additions & 14 deletions src/python/espressomd/visualization_opengl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1587,22 +1587,17 @@ def _init_espresso_visualization(self):
self.depth = 0

# LOOK FOR LB ACTOR
if self.specs['LB_draw_velocity_plane'] or \
self.specs['LB_draw_nodes'] or \
self.specs['LB_draw_node_boundaries']:
lb_types = [espressomd.lb.LBFluid]
if espressomd.has_features('CUDA'):
lb_types.append(espressomd.lb.LBFluidGPU)
for a in self.system.actors:
if isinstance(a, tuple(lb_types)):
# if 'agrid' in pa:
self.lb_params = a.get_params()
self.lb = a
self.lb_is_cpu = isinstance(a, espressomd.lb.LBFluid)
break
lb_types = [espressomd.lb.LBFluid]
if espressomd.has_features('CUDA'):
lb_types.append(espressomd.lb.LBFluidGPU)
for actor in self.system.actors:
if isinstance(actor, tuple(lb_types)):
self.lb_params = actor.get_params()
self.lb = actor
self.lb_is_cpu = isinstance(actor, espressomd.lb.LBFluid)
break

if self.specs['LB_draw_velocity_plane']:

if self.specs['LB_plane_axis'] == 0:
pn = [1.0, 0.0, 0.0]
self.lb_plane_b1 = [0.0, 1.0, 0.0]
Expand Down

0 comments on commit 6ff54a3

Please sign in to comment.