Dislocation patterning: from micro- to mesoscale description