Skip to content

Issue when build_dataframe=True with transient analysis. #845

@marcodesiderio

Description

@marcodesiderio

When building a dataframe with the transient analysis, I think the df.index is being built incorrectly.

given:

df = op2.get_result(result_name)[1].dataframe

in my case the dataframe - if filtered by element ID 1, has a total of 80 rows - which is expected:
5 nodes per element (N1, N2, N3, N4) x 2 Location (top, bottom) x 8 outputs ('fiber_distance', 'oxx', 'oyy', 'txy', 'angle', 'omax', 'omin', 'von_mises').

However, let's now see how many of these rows are unique:

tuple_set = set()
for item in df.index:
if item[0] == 1:
print(item)
tuple_set.add(item)

now len(tuple_set) yields 10 and the following is output:

Image

clearly some duplicate rows. I suspect the fix should be made here:

https://github.com/SteveDoyle2/pyNastran/blob/main/pyNastran/op2/tables/oes_stressStrain/real/oes_plates.py

Essentially what I believe is happening is that for each combination of Node and Location, only one of the ouputs is output - e.g.
1, 'CEN', 'Top' only yields 'fiber_distance'
1, 'CEN', 'Bottom' only yields 'oxx'

There is probably some small bug where when the new MultiIndex tuples are created, something is being mixed up.

UPDATE:

After doing some digging, it appears that this issue is caused by the way in which the eid_nid_item vector is flattened.

eid_nid_item.append(eidi.ravel())

Which flattens it row-wise, while apparently it should be flattened column-wise:

eid_nid_item.append(eidi.ravel(order='F'))

seems to solve the issue.

I suspect this might need to be changed for other outputs as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions