Electromagnetic field solver