Пример #1
0
def dogpack_timestepper_from_dict(dict_):
    # 1st Order - Forward Euler
    # 2nd Order - TVDRK2
    # 3rd Order - TVDRK3
    # 4th Order - SSP RK4 10 stages
    # 5th Order - 8 Stages
    order = dict_["order"]
    num_frames = dict_["num_frames"]
    is_verbose = dict_["is_verbose"]
    target_cfl = dict_["target_cfl"]
    if target_cfl == "auto":
        target_cfl = get_dogpack_auto_cfl_target(order)

    max_cfl = dict_["max_cfl"]
    if max_cfl == "auto":
        max_cfl = get_dogpack_auto_cfl_max(order)

    dogpack_timestep_function = get_dogpack_timestep_function(
        target_cfl, max_cfl)
    if order == 1:
        return explicit_runge_kutta.ForwardEuler(num_frames,
                                                 dogpack_timestep_function,
                                                 is_verbose)
    elif order == 2:
        return explicit_runge_kutta.TVDRK2(num_frames,
                                           dogpack_timestep_function,
                                           is_verbose)
    elif order == 3:
        return explicit_runge_kutta.TVDRK3(num_frames,
                                           dogpack_timestep_function,
                                           is_verbose)
    elif order == 4:
        return low_storage_explicit_runge_kutta.SSP4(
            num_frames, dogpack_timestep_function, is_verbose)
    else:
        raise errors.InvalidParameter("order", order)
def test_tvd_rk3_linear():
    tvd_rk3 = explicit_runge_kutta.TVDRK3()
    odes.check_linear_case(tvd_rk3)
def test_tvd_rk3():
    tvd_rk3 = explicit_runge_kutta.TVDRK3()
    odes.sample_odes(tvd_rk3, 3)
def test_tvd_rk3_steady_state():
    tvd_rk3 = explicit_runge_kutta.TVDRK3()
    odes.check_steady_state_case(tvd_rk3)
def test_tvd_rk3_event_hooks():
    tvd_rk3 = explicit_runge_kutta.TVDRK3()
    odes.check_event_hooks(tvd_rk3)