Getting information on elements in PyDPF

Options
Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 810
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: 810
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Answer ✓
    Options

    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
    

Answers

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 283
    First Anniversary First Comment 5 Likes Ansys Employee
    edited March 20
    Options

    FYI... for a list of element type ids in the results file you can use this: (mech DPF implementation)

    import mech_dpf
    import Ans.DataProcessing as dpf
    my_data_sources = dpf.DataSources(Model.Analyses[1].ResultFileName)
    op = dpf.operators.metadata.property_field_provider_by_name() # operator instantiation
    op.inputs.data_sources.Connect(my_data_sources)
    op.inputs.property_name.Connect('mapdl_element_type_id')
    my_property_field = op.outputs.property_field.GetData()
    Ids = set(my_property_field.Data)
    Ids