diff --git a/samples/lj-demo.py b/samples/lj-demo.py index 46173f31cbf..eeab45f217a 100644 --- a/samples/lj-demo.py +++ b/samples/lj-demo.py @@ -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 diff --git a/src/python/espressomd/visualization_opengl.py b/src/python/espressomd/visualization_opengl.py index 3984349bc66..9b4b7588fe4 100644 --- a/src/python/espressomd/visualization_opengl.py +++ b/src/python/espressomd/visualization_opengl.py @@ -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]