A discrete to continuum analysis of dislocations in nanowire heterostructures