Get elemental nodal stress array along with corresponding node ids

Options
Samukham
Samukham Member Posts: 35
First Anniversary First Comment Name Dropper
edited April 2023 in General Language Questions

Dear Team,

I am reaching out for help with organizing stress tensors for all elemental nodes using the API call (self.model.results.stress.eval()[0].data). This API call generates an array of stress tensors (elementalNodal) for all the elements, and I need to create another array with the corresponding node IDs for each stress tensor.

I'm experiencing difficulty generating the node IDs array because for some elements in the model, dpf outputs an array of 6 nodes connected to the particular element (self.model.metadata.meshed_region.elements[x].node_ids), while for the same element, dpf outputs 8 stress tensors (self.model.results.stress.eval()[0].get_entity_data(x)), with two pairs of identical tensors. Upon checking the element type, it appears to be a 'wedge6' element.

I am in need of generating two arrays which contain elemental node IDs in the order [nodes_at_element_1, nodes_at_element_2, nodes_at_element_3,...] and their corresponding stress tensors. As there are a high number of elements in the model, looping over the elements or nodes is not a feasible solution due to time consumption.

Could you please assist me with this issue? I would appreciate your valuable suggestions on how to solve this problem.

Thank you for your support.

Best regards,

Samukham

Tagged: