On boundary conditions for a simulation plasma in a magnetic field