How can I calculate joint forces on MPC184 elements using PyDPF?

Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 367
100 Answers 100 Comments 100 Likes First Anniversary

How can I calculate joint forces on MPC184 elements using PyDPF?

Tagged:

Comments

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 367
    100 Answers 100 Comments 100 Likes First Anniversary
    edited August 17

    You need to know the MPC184 Element ID, that can be found using the User Defined Result in Mechanical "PNUMELEM" and then use the following code.

    from ansys.dpf import core as dpf
    
    rst_path = r"\Path\to\file.rst"
    model = dpf.Model(rst_path)
    
    ms = dpf.Scoping()
    """ MPC 184 Element ID eg. 3774 """
    ms.ids = [3771] jfx = model.operator("mapdl::smisc")
    jfx.inputs.mesh_scoping.connect(ms)
    """ Use the following indexes in the next line.
    1: Fx, 2: Fy, 3: Fz """ jfx.inputs.item_index.connect(1)
    fx = jfx.outputs.fields_container.get_data()[0].data