Calculation of the elastic strain energy of inclusions by the Green's function and finite element methods