Magnetization dynamics in thin films by finite formulation