How to extract nodal stress results from elemental named selection?
Ayush Kumar
Member, Moderator, Employee Posts: 450
✭✭✭✭
How to extract nodal stress results from elemental named selection and save the mapped stress results modified using a function?
Tagged:
2
Answers
-
Please change the index in line, this might vary:
mapped_stress_x.update({str(node): normal_stress.PlotData.Values[2][index]})
ns = Model.NamedSelections.Children[0] # Get element ids elements = ns.Location.Ids mesh = Model.Analyses[0].MeshData # Get nodes associated with elements nodes = mesh.NodeIdsFromElementIds(elements) # Add a result object normal_stress = Model.Analyses[0].Solution.AddNormalStress() # Scope named selection normal_stress.ScopingMethod = GeometryDefineByType.Component normal_stress.Location = ns ExtAPI.DataModel.Tree.Refresh() Model.Analyses[0].Solution.EvaluateAllResults() mapped_stress_x = {} # Get indexes of nodes for node in nodes: index = list(normal_stress.PlotData.Values[1]).index(node) mapped_stress_x.update({str(node): normal_stress.PlotData.Values[2][index]})
0