Finite element analysis of strain localization in multiphase materials