Modeling of current crowding accompanying optical filament formation in semiconductor lasers and amplifiers