Calculating charge distributions and currents in metals induced by an optical field