Phase-field simulation of martensitic transformation with different conditions in inhomogeneous polycrystals