Finite Element And Integral Equation Formulations For High -Performance Micromagnetic And Electromagnetic Solvers