The modelling of dislocation patterns