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

Options
Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 419
5 Likes First Anniversary Ansys Employee Solution Developer Community of Practice Member

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

Tagged:

Comments

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 419
    5 Likes First Anniversary Ansys Employee Solution Developer Community of Practice Member
    edited August 2023
    Options

    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