Fast Calculation of the Green's Function of a Boxed Resonator through Ewald's Technique