Computation of second-order correlation energies using a finite element method for atoms with d electrons