Interactive electric field calculations for lasers