  Photon Green function (GF) is the vital and most decisive factor in the field
of quantum light-matter interaction. It is divergent with two equal space
arguments in arbitrary-shaped lossy structure and should be regularized. We
introduce a finite element method for calculating the regularized GF. It is
expressed by the averaged radiation electric field over the finite-size of the
photon emitter. For emitter located in homogeneous lossy material, excellent
agreement with the analytical results is found for both real cavity model and
virtual cavity model. For emitter located in a metal nano-sphere, the
regularized scattered GF, which is the difference between the regularized GF
and the analytical regularized one in homogeneous space, agrees well with the
analytical scattered GF.
