Getting information on elements in PyDPF
Pernelle Marone-Hitz
Member, Moderator, Employee Posts: 871
✭✭✭✭
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:
1
Best 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
0
Answers
-
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)
Ids0