Computer techniques for electromagnetics