A moving interface finite element formulation for layered structures