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
评论列表
文章目录