def test_tetrahedron():
quadpy.tetrahedron.integrate(
lambda x: numpy.exp(x[0]),
numpy.array([
[0, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1]
], dtype=float),
quadpy.tetrahedron.ShunnHam(3)
)
quadpy.tetrahedron.integrate(
lambda x: [numpy.exp(x[0]), numpy.exp(x[1])],
numpy.stack([
[[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0], [0.0, 0, 1]],
[[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0], [0.0, 0, 1]],
[[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0], [0.0, 0, 1]],
[[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0], [0.0, 0, 1]],
], axis=-2),
quadpy.tetrahedron.ShunnHam(3)
)
return
评论列表
文章目录