Пример #1
0
def test_get_good_scheme():
    degree = 0
    while True:
        best = find_best_scheme(
            quadpy.u3.schemes.values(),
            degree,
            # lambda pts: True,
            lambda pts: numpy.all(
                numpy.abs(pts[0] ** 2 + pts[1] ** 2 + pts[2] ** 2 - 1.0) < 1.0e-13
            ),
            lambda keys: len(
                keys
                - set(["a1", "a2", "a3", "rs0", "llm2", "rsw2", "pq0", "llm", "rsw"])
            )
            == 0,
        )
        if best is None:
            break

        b = quadpy.u3.get_good_scheme(degree)

        assert best.name == b.name, f"{best.name} != {b.name}"
        degree += 1

    assert degree == 48
Пример #2
0
def test_get_good_scheme():
    degree = 0
    while True:
        best = find_best_scheme(
            quadpy.e2r2.schemes.values(),
            degree,
            lambda pts: True,
            lambda keys: "plain" not in keys,
        )
        if best is None:
            break

        b = quadpy.e2r2.get_good_scheme(degree)
        assert best.name == b.name, f"{best.name} != {b.name}"
        degree += 1

    assert degree == 16
Пример #3
0
def test_get_good_scheme():
    degree = 0
    while True:
        best = find_best_scheme(
            quadpy.c2.schemes.values(),
            degree,
            lambda pts: np.all((pts >= -1) & (pts <= 1)),
            lambda keys: len(keys - {"d4_a0", "d4_aa", "d4_ab", "zero2"}) == 0,
        )
        if best is None:
            break

        b = quadpy.c2.get_good_scheme(degree)

        assert best.name == b.name, f"{best.name} != {b.name}"
        degree += 1

    assert degree == 22
Пример #4
0
def test_get_good_scheme():
    degree = 0
    while True:
        best = find_best_scheme(
            quadpy.s3.schemes.values(),
            degree,
            lambda pts: numpy.all((pts[0]**2 + pts[1]**2 + pts[2]**2 <= 1)),
            lambda keys: len(keys - set([
                "zero3", "symm_r00", "symm_rr0", "symm_rrr", "symm_rrs"
            ])) == 0,
        )
        if best is None:
            break

        # print(degree, best.name)
        b = quadpy.s3.get_good_scheme(degree)
        assert best.name == b.name, f"{best.name} != {b.name}"
        degree += 1
Пример #5
0
def test_get_good_scheme():
    degree = 0
    while True:
        best = find_best_scheme(
            quadpy.t2.schemes.values(),
            degree,
            lambda pts: numpy.all(pts >= 0),
            lambda keys: len(keys - set(["d3_aa", "d3_ab", "centroid", "vertex"])) == 0,
        )
        if best is None:
            break

        b = quadpy.t2.get_good_scheme(degree)

        assert best.name == b.name, f"{best.name} != {b.name}"
        degree += 1

    assert degree == 51
Пример #6
0
def test_get_good_scheme():
    degree = 0
    while True:
        best = find_best_scheme(
            quadpy.s2.schemes.values(),
            degree,
            lambda pts: numpy.all(pts[0]**2 + pts[1]**2 <= 1),
            lambda keys: "plain" not in keys,
        )
        if best is None:
            break

        b = quadpy.s2.get_good_scheme(degree)

        assert best.name == b.name, f"{best.name} != {b.name}"
        degree += 1

    assert degree == 20
Пример #7
0
def test_get_good_scheme():
    degree = 0
    while True:
        best = find_best_scheme(
            quadpy.e3r2.schemes.values(),
            degree,
            lambda pts: True,
            lambda keys: len(keys - {
                "zero3", "symm_r00", "symm_rr0", "symm_rrr", "symm_rrs"
            }) == 0,
        )
        if best is None:
            break

        # print(degree, best.name)
        b = quadpy.e3r2.get_good_scheme(degree)
        assert best.name == b.name, f"{best.name} != {b.name}"
        degree += 1

    assert degree == 8