Density functional theory study on hydrogenation mechanism in catalyst-activated Mg(0001) surface