add boundary condition for magnetic potential