Software tool methodologies on a GPU for finite element optimization in magnetics