Dislocations in nanowire heterostructures: from discrete to continuum