Numerical simulation of semiconductor devices