A numerical model of dike propagation in layered elastic media