def boundary_condition(self):
for i in range(self.dim):<EOL><INDENT>mask = (self.pos[:,i] < <NUM_LIT:0>)<EOL>self.pos[mask,i] = <NUM_LIT:2>*<NUM_LIT:0>-self.pos[mask,i]<EOL>self.vel[mask,i] *= -<NUM_LIT:1><EOL>mask = (self.pos[:,i] > self.box[i])<EOL>self.pos[mask,i] = <NUM_LIT:2>*self.box[i]-self.pos[mask,i]<EOL>self.vel[mask,i] *= -<NUM_LIT:1><EOL><DEDENT>
Apply hard reflective boundary conditions to particles