We study the local structure of the vorticity field and the Λ polarization in Au+Au collisions in the energy range √ sNN = 7.7-200 GeV and Pb+Pb collisions at √ sNN = 2760 GeV using A Multi-Phase Transport (AMPT) model. We focus on the vorticity field arising from the non-uniform expansion of the fireball, which gives the circular structure of the transverse vorticity ω ⊥ = (ωx, ωy) around the z direction as well as the quadrupole pattern of the longitudinal vorticity ωz in the transverse plane. As a consequence, the three components of the polarization vector P = (Px, Py, Pz) for Λ hyperons show harmonic behaviors as sgn(Y ) sin φp, −sgn(Y ) cos φp, and − sin(2φp), where φp and Y are the azimuthal angle and rapidity in momentum space. These patterns of the local Λ polarization are expected to be tested in future experiments.