  We investigate the effect of $U (1)$ gauge field on lattice fermion systems
with a curved domain-wall mass term. In the same way as the conventional flat
domain-wall fermion, the chiral edge modes appear localized at the wall, whose
Dirac operator contains the induced gravitational potential as well as the
$U(1)$ vector potential. In the case of $S^1$ domain-wall fermion on a
two-dimensional flat lattice, we find a competition between the
Aharonov-Bohm(AB) effect and gravitational gap in the Dirac eigenvalue
spectrum, which leads to anomaly of the time-reversal ($T$) symmetry. Our
numerical result shows a good consistency with the Atiyah-Patodi-Singer index
theorem on a disk inside the $S^1$ domain-wall, which describes the
cancellation of the $T$ anomaly between the bulk and edge. When the $U(1)$ flux
is squeezed inside one plaquette, and the AB phase takes a quantized value
$\pi$ mod $2\pi\mathbb{Z}$, the anomaly inflow drastically changes: the strong
flux creates another domain-wall around the flux to make the two zero modes
coexist. This phenomenon is also observed in the $S^2$ domain-wall fermion in
the presence of a magnetic monopole. We find that the domain-wall creation
around the monopole microscopically explains the Witten effect.
