Development of branching brittle and ductile shear zones: A numerical study