Exemple #1
0
    n = 200  # number of increments
    s_levels = np.linspace(0, 0.00125, 2)
    s_levels.reshape(-1, 2)[:, 0] = 0.0
    #s_levels.reshape(-1, 2)[:, 1] = -0.005
    s_levels[0] = 0
    s_history_1 = s_levels.flatten()
    d_array = np.hstack([
        np.linspace(s_history_1[i], s_history_1[i + 1], n)
        for i in range(len(s_levels) - 1)
    ])

    t_max = 1.0
    t_arr = np.linspace(0, t_max, len(d_array))
    print 't_arr ', t_arr
    time_func = MFnLineArray(xdata=t_arr, ydata=d_array)
    time_func.extrapolate = 'constant'
    print 'time_func', time_func
    time_func_2 = interp1d(t_arr, d_array)
    print 'time_func_2', time_func_2

    #     ts.bc_list = [BCDof(var='u', dof=0, value=0.0), BCDof(var='f', dof=n_dofs - 1, time_function=loading_scenario.time_func)]

    if False:
        tloop.bc_list = [
            BCSlice(slice=dots.mesh[0, :, 0, :], var='u', dims=[0, 1],
                    value=0),
            BCSlice(slice=dots.mesh[25, -1, :, -1],
                    var='u',
                    dims=[1],
                    value=-50),
            BCSlice(slice=dots.mesh[-1, :, -1, :],