test_timestepping.py 文件源码

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

项目:opensbli 作者: opensbli 项目源码 文件源码
def test_rk3(rk3):
    """ Ensure that an RK3 time-stepping scheme is set up correctly. """

    assert rk3.order == 3

    # Stages of the RK scheme.
    stage = Symbol('stage', integer=True)
    old = IndexedBase('rkold')[stage]
    new = IndexedBase('rknew')[stage]

    coefficients = rk3.get_coefficients()
    assert coefficients[old.base] == [Rational(1.0,4.0), Rational(3.0,20), Rational(3.0,5.0)]
    assert coefficients[new.base] == [Rational(2,3), Rational(5,12), Rational(3,5)]

    return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号