Ejemplo n.º 1
0
def test_singularities_ks_raises_NotImplementedError():
    """
    Tests, if a NotImplementedError is raised, when KerrSchild coordinates \
    are used with ``singularities()``

    """
    mk = Kerr(coords="KS", M=1e22, a=0.5)

    try:
        mk_sing = mk.singularities()
        assert False

    except NotImplementedError:
        assert True
Ejemplo n.º 2
0
def test_singularities_for_uncharged_nonrotating_case():
    """
    Tests, if all metric singularities match up across Schwarzschild, Kerr & Kerr-Newman \
    spacetimes, when a -> 0 & Q -> 0, subject to choice to coordinates (here, Spherical and BL)

    """
    theta = np.pi / 4
    M, a, Q = 5e27, 0., 0.

    ms = Schwarzschild(M=M)
    mk = Kerr(coords="BL", M=M, a=a)
    mkn = KerrNewman(coords="BL", M=M, a=a, Q=Q)
    mssing = ms.singularities()
    mksing = mk.singularities()
    mknsing = mkn.singularities()

    mssinglist = [
        mssing["inner_ergosphere"],
        mssing["inner_horizon"],
        mssing["outer_horizon"],
        mssing["outer_ergosphere"]
    ]

    mksinglist = [
        mksing["inner_ergosphere"](theta),
        mksing["inner_horizon"],
        mksing["outer_horizon"],
        mksing["outer_ergosphere"](theta)
    ]

    mknsinglist = [
        mknsing["inner_ergosphere"](theta),
        mknsing["inner_horizon"],
        mknsing["outer_horizon"],
        mknsing["outer_ergosphere"](theta)
    ]

    scr = ms.schwarzschild_radius(M)

    assert_allclose(mssinglist, mksinglist, rtol=1e-4, atol=0.0)
    assert_allclose(mksinglist, mknsinglist, rtol=1e-4, atol=0.0)
    assert_allclose(mknsinglist, mssinglist, rtol=1e-4, atol=0.0)
    assert_allclose(mksinglist[2], scr, rtol=1e-4, atol=0.0)