Getting information on elements in PyDPF

Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 715
First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
edited June 2023 in Structures

In PyDPF, how can I get:

  • the APDL element type (ie SOLID185, PLANE182, ...)
  • the APDL element type id (ie getting  the "1" value in et,1,185)
Tagged:

Best Answer

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 715
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Answer ✓

    For the APDL element type, use:

    import ansys.dpf.core as dpf
    model = dpf.Model(r"c:\temp\file.rst")
    mesh = model.metadata.meshed_region
    mesh.available_property_fields
    field = mesh.property_field("apdl_element_type")
    

    For the APDL element type id, use:

    op = dpf.operators.metadata.property_field_provider_by_name()
    op.inputs.streams_container.connect(model.metadata.streams_provider.outputs.streams_container)
    op.inputs.property_name.connect("mapdl_element_type_id")
    field = op.eval()
    field.data