A new efficient method for density functional theory calculations of inhomogeneous fluids