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

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

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

Tagged:

Comments

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 467
    100 Answers 250 Likes 100 Comments Second Anniversary
    ✭✭✭✭
    edited August 2023

    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