A numerical method is proposed for analyzing the shielding current density in a high-temperature superconducting (HTS) film containing cracks/holes. If an HTS film contains cracks or holes, an integral form of Faraday's law is also imposed as the boundary condition. Since the integral form can be completely incorporated into the weak form, it is regarded as the natural boundary condition. Thus, the weak form has only to be solved with the essential boundary conditions. However, the resulting numerical solution does not satisfy the integral form exactly. In order to resolve this problem, the following method is proposed: virtual voltages be applied along the surfaces of cracks and holes so as to have Faraday's law numerically satisfied. By using the proposed method, the influence of a crack on the permanent magnet method is investigated numerically.