A new method for computing nonlinear carrier diffusion in semiconductor optical devices