test_tetrahedron.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:quadpy 作者: nschloe 项目源码 文件源码
def test_scheme(scheme):
    # Test integration until we get to a polynomial degree `d` that can no
    # longer be integrated exactly. The scheme's degree is `d-1`.
    tetrahedron = numpy.array([
        [0.0, 0.0, 0.0],
        [1.0, 0.0, 0.0],
        [0.0, 1.0, 0.0],
        [0.0, 0.0, 1.0],
        ])
    degree = check_degree(
            lambda poly: quadpy.tetrahedron.integrate(
                poly, tetrahedron, scheme
                ),
            integrate_monomial_over_unit_simplex,
            3,
            scheme.degree + 1,
            )
    assert degree == scheme.degree, \
        'Observed: {}, expected: {}'.format(degree, scheme.degree)
    return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号