stress_von_mises Operator with nodal stress order of output



I am working on script that have to extract data - node ids, coordinates, displacement and Von misses stress to csv. As coordinates and displacement works fine, stress seems to be working differently, order of output is different - not sorted by node ids.
below is part of the code that is extracting stress.

 stress_von_mises = ops.result.stress_von_mises(data_sources=model)
    # Restrict scoping to named selection

While i am using above method first element of array is not a stress at first node that i am extracting from scoping with method as below.


While i am using same methodology for displacement it works fine. I don't understand why this is happening with stress.

displacement = ops.result.displacement(data_sources=model)
    # Restrict scoping to named selection

Do you know how i can retrieve the order that stress are written into the field ?

as the code need to be efficient i can't use extraction with for loop and extracting by one node at the time (get_entity_data_by_id for example)



  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 279
    First Anniversary First Comment 5 Likes Ansys Employee

    How do you know the “correct” order of the calculated values? Are you matching values with some other validated method?
    If you have a reproducible case of the values not matching the order of the nodal scoping ids this should be filed as a defect.

  • kacper.J
    kacper.J Member Posts: 4
    Name Dropper First Comment

    so i know a nodes from node_ids=nodal_scope.ids i am using for displacement and data written from DPF match with result i am taking from APDL, but while i am taking the first data from stress field its not the same as in apdl for first node at node_ids=nodal_scope.ids

    anyway i found a way to extract node ids directly from field container and it solved a problem in this way order of ids match with order of stress