Magnetic shielding of a laboratory Hall thruster. I. Theory and validation