Analysis of a second order discontinuous Galerkin finite element method for the Allen-Cahn equation