Structure-preserving discretization of a coupled Allen-Cahn and heat equation system