Three-dimensional Computation of Magnetic Fields in hysteretic media with time-periodic sources