label atomi variable atomi loop 1 $(v_natoms) variable x equal x[${atomi}] variable y equal y[${atomi}] variable z equal z[${atomi}] if "$(v_x>lx)" then & "variable x equal $(v_x-lx)" if "$(v_y>ly)" then & "variable y equal $(v_y-ly)" if "$(v_z>lz)" then & "variable z equal $(v_z-lz)" if "$(v_x<0)" then & "variable x equal $(v_x+lx)" if "$(v_y<0)" then & "variable y equal $(v_y+ly)" if "$(v_z<0)" then & "variable z equal $(v_z+lz)" group atomi id ${atomi} set atom ${atomi} x $x set atom ${atomi} y $y set atom ${atomi} z $z group atomi delete next atomi jump SELF atomi