Get DPF Time Scoping by Load step and sub-step

Options
Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 510
100 Answers 250 Likes 100 Comments Second Anniversary
✭✭✭✭

Get DPF Time Scoping by Load step and sub-step

Tagged:

Comments

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 510
    100 Answers 250 Likes 100 Comments Second Anniversary
    ✭✭✭✭
    from ansys.dpf import core as dpf
    
    rst = r"C:\...\file.rst"
    model = dpf.Model(rst)
    
    def get_ls_sb_scoping(ls_sb_set):
        ts = dpf.Scoping()
        ts_ids = []
        for ls_sb in ls_sb_set:
            ls = ls_sb[0]
            sb = ls_sb[1]
            c_index = dpf.time_freq_scoping_factory.scoping_by_step_and_substep(ls, sb, model.metadata.time_freq_support).ids[0]
            ts_ids.append(c_index)
        ts.ids = ts_ids
        return ts
    
    ls_sb_set = [(3, 1), (5, 4), (5, 5)]
    ts = get_ls_sb_scoping(ls_sb_set)
    print(ts)