Electromagnetic wave solver