Demagnetization factors for cylindrical shells and related shapes