Extract PointData from d3plot files

Options

Hi,

I would like to understand the correct method for extracting LSDyna results from our d3plot files and adapting them for a web application.
Specifically, we are attempting to extract PointData and create VTK objects to display in our Dash app.
Currently, we have successfully extracted the FieldsContainer, but we are uncertain about how to correctly extract the data.
The provided code represents our best attempt.
We believe that we have successfully extracted the correct PointData, but unfortunately, the data seems to be in the wrong order.
It appears as though all the PointData is misordered, leading to wronged colors in the visual when we attempt to recreate it.

ds = dpf.DataSources()
ds.set_result_file_path(resultFilePath, "d3plot")
model = dpf.Model(ds)
metadata = model.metadata

opVM = dpf.operators.result.stress_von_mises()
opVM.inputs.requested_location.connect("Nodal")
opVM.inputs.data_sources.connect(ds)
opVM.inputs.time_scoping.connect(liste_times_simu.tolist())
vm_fields_container = opVM.outputs.fields_container()

# We believe that this extracts the good data, but it is definitly not in the good order
GOOD_PT_DATA_NOT_WELL_ORDERED = vm_fields_container[21].data[field._data_pointer_as_list]

My questions are:

  • Where and how can I properly extract the PointData from a Field object?
  • Is there an easier way to create objects for our Dash application?
  • Is there a way to directly create HTML elements from our FieldsContainer?

Our best solution so far is creating a VTK file for each frame and then extracting the PointData.
Is there a better solution?

vtkExporter = dpf.operators.serialization.vtk_export()
vtkExporter.inputs.file_path.connect(r'frame21.vtk')
vtkExporter.inputs.fields1.connect(opVM.outputs.fields_container())
vtkExporter.inputs.mesh.connect(metadata.meshed_region)
vtkExporter.run()

However, this approach requires too much space, as we would need to generate over 100 files in our case.

Thank you very much!

Tagged:

Answers

  • Chris Harrold
    Chris Harrold Member, Administrator, Employee Posts: 169
    First Answer First Comment First Anniversary Ansys Employee
    admin
    Options

    @BRusu - this is VERY old now, but @Ramdane would be a good resource for asking this (if you've not already gotten an answer) So sorry this sat for so long, and I will keep an eye out to see if you get an answer.