Preserving data moments in density estimation via diffusion using the finite element method