An Adaptive Finite Element Solver for Demagnetization Field Calculation