A three-dimensional cellular automaton model for simulation of dendritic growth of magnesium alloy