Local demagnetizing tensor calculation for arbitrary non-ellipsoidal bodies