How to print named_selections for a LSDYNA file using Py-DPF Core
I want to extract field containers from an LSDYNA file for a specific location. However, when I attempt to print the named selections using the code below, it returns an empty list and throws the following error:
path0 = r'C:\my_path'
path = os.path.join(path0, "d3plot")
act_units = os.path.join(path0, "file.actunits")
ds = dpf.DataSources()
ds.set_result_file_path(path, "d3plot")
ds.add_file_path(act_units , "actunits")
model = dpf.Model(ds)
print('Named selections in model:', model.metadata.available_named_selections)
time_freq_support = model.metadata.time_freq_support
num_time_steps = len(time_freq_support.time_frequencies.data)
time_scoping = list(range(num_time_steps+1))
op_von_mises = dpf.operators.result.stress_von_mises() # operator instantiation
op_von_mises.inputs.time_scoping.connect(time_scoping)
op_von_mises.inputs.data_sources.connect(ds)
op_von_mises.inputs.requested_location.connect('VALVE')
fields_container_eqv = op_von_mises.outputs.fields_container()
''DPFServerException: S_eqv:1248<-eqv_fc:1255<-S:1254<-averaging from Elemental to VALVE is not implemented''
Answers
-
@hbolandi d3plots don't have any information on the named-selections you create in Ansys Mechanical LS-Dyna. Therefore, you can't extract them using DPF down the line. For now, I can suggest writing out the Element / Node IDs in a file and reading that in your post-processing session to be used in the Scoping for DPF.
0