SteveDoyle2 / pyNastran

A Python-based interface tool for Nastran's file formats
Other
384 stars 147 forks source link

nastran_to_vtk bug #780

Closed karma0704 closed 4 months ago

karma0704 commented 4 months ago

The parsed OP2 result data does not consider the situation of multiple working conditions (SUBCASE1, SUBCASE2, and so on). As a result, when converting to VTK files, different working conditions should be correctly written to different subcases, but now All are written to subcase1-1, and the data is overwritten. The data of subcase2 is written to subcase1.

As you can see from the two pictures above, after converting to VTK, two Subcases should be written, each with stress data of the triangular unit, but the generated VTK file only contains subcase1, and the storage in subcase1 is actually subcase2. data

SteveDoyle2 commented 4 months ago

Can you provide a small example? A 1 element problem with 2 different loadings (and thus displacement/stress) is ideal.

On Thu, Apr 18, 2024 at 3:08 AM karma0704 @.***> wrote:

The parsed OP2 result data does not consider the situation of multiple working conditions (SUBCASE1, SUBCASE2, and so on). As a result, when converting to VTK files, different working conditions should be correctly written to different subcases, but now All are written to subcase1-1, and the data is overwritten. The data of subcase2 is written to subcase1.

image.png (view on web) https://github.com/SteveDoyle2/pyNastran/assets/63630092/878c52d5-2c86-4611-97e5-25809490827c

image.png (view on web) https://github.com/SteveDoyle2/pyNastran/assets/63630092/2f3a2bc6-2159-4dce-a886-90703e49bc05

As you can see from the two pictures above, after converting to VTK, two Subcases should be written, each with stress data of the triangular unit, but the generated VTK file only contains subcase1, and the storage in subcase1 is actually subcase2. data

— Reply to this email directly, view it on GitHub https://github.com/SteveDoyle2/pyNastran/issues/780, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAICUWJW272CEUA5WZNVQHTY56LQBAVCNFSM6AAAAABGM6K22OVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2TAMRZGAYTQMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

karma0704 commented 4 months ago

Can you provide a small example? A 1 element problem with 2 different loadings (and thus displacement/stress) is ideal. On Thu, Apr 18, 2024 at 3:08 AM karma0704 @.> wrote: The parsed OP2 result data does not consider the situation of multiple working conditions (SUBCASE1, SUBCASE2, and so on). As a result, when converting to VTK files, different working conditions should be correctly written to different subcases, but now All are written to subcase1-1, and the data is overwritten. The data of subcase2 is written to subcase1. image.png (view on web) https://github.com/SteveDoyle2/pyNastran/assets/63630092/878c52d5-2c86-4611-97e5-25809490827c image.png (view on web) https://github.com/SteveDoyle2/pyNastran/assets/63630092/2f3a2bc6-2159-4dce-a886-90703e49bc05 As you can see from the two pictures above, after converting to VTK, two Subcases should be written, each with stress data of the triangular unit, but the generated VTK file only contains subcase1, and the storage in subcase1 is actually subcase2. data — Reply to this email directly, view it on GitHub <#780>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAICUWJW272CEUA5WZNVQHTY56LQBAVCNFSM6AAAAABGM6K22OVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2TAMRZGAYTQMA . You are receiving this because you are subscribed to this thread.Message ID: @.>

demo.zip this is a demo

SteveDoyle2 commented 4 months ago

I didn't see the specific issue in the file you attached, but I updated the code to always write the icase=... tag. It's the easy way to avoid the counter (-1) that you saw. That was happening because the titles were overlapping.

I didn't see any examples of the subcases being wrong though. Take a look at the new version and hopefully the issue of missing cases is just gone.

On Thu, Apr 18, 2024 at 5:07 PM karma0704 @.***> wrote:

Can you provide a small example? A 1 element problem with 2 different loadings (and thus displacement/stress) is ideal. … <#m5400790347379029356> On Thu, Apr 18, 2024 at 3:08 AM karma0704 @.> wrote: The parsed OP2 result data does not consider the situation of multiple working conditions (SUBCASE1, SUBCASE2, and so on). As a result, when converting to VTK files, different working conditions should be correctly written to different subcases, but now All are written to subcase1-1, and the data is overwritten. The data of subcase2 is written to subcase1. image.png (view on web) https://github.com/SteveDoyle2/pyNastran/assets/63630092/878c52d5-2c86-4611-97e5-25809490827c https://github.com/SteveDoyle2/pyNastran/assets/63630092/878c52d5-2c86-4611-97e5-25809490827c image.png (view on web) https://github.com/SteveDoyle2/pyNastran/assets/63630092/2f3a2bc6-2159-4dce-a886-90703e49bc05 https://github.com/SteveDoyle2/pyNastran/assets/63630092/2f3a2bc6-2159-4dce-a886-90703e49bc05 As you can see from the two pictures above, after converting to VTK, two Subcases should be written, each with stress data of the triangular unit, but the generated VTK file only contains subcase1, and the storage in subcase1 is actually subcase2. data — Reply to this email directly, view it on GitHub <#780 https://github.com/SteveDoyle2/pyNastran/issues/780>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAICUWJW272CEUA5WZNVQHTY56LQBAVCNFSM6AAAAABGM6K22OVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2TAMRZGAYTQMA https://github.com/notifications/unsubscribe-auth/AAICUWJW272CEUA5WZNVQHTY56LQBAVCNFSM6AAAAABGM6K22OVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2TAMRZGAYTQMA . You are receiving this because you are subscribed to this thread.Message ID: @.>

demo.zip https://github.com/SteveDoyle2/pyNastran/files/15031551/demo.zip this is a demo

— Reply to this email directly, view it on GitHub https://github.com/SteveDoyle2/pyNastran/issues/780#issuecomment-2065512391, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAICUWLPWWY5OBAW7MMQRDTY6BN3HAVCNFSM6AAAAABGM6K22OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRVGUYTEMZZGE . You are receiving this because you commented.Message ID: @.***>

karma0704 commented 4 months ago

image

I didn't see the specific issue in the file you attached, but I updated the code to always write the icase=... tag. It's the easy way to avoid the counter (-1) that you saw. That was happening because the titles were overlapping. I didn't see any examples of the subcases being wrong though. Take a look at the new version and hopefully the issue of missing cases is just gone. On Thu, Apr 18, 2024 at 5:07 PM karma0704 @.> wrote: Can you provide a small example? A 1 element problem with 2 different loadings (and thus displacement/stress) is ideal. … <#m5400790347379029356> On Thu, Apr 18, 2024 at 3:08 AM karma0704 @.> wrote: The parsed OP2 result data does not consider the situation of multiple working conditions (SUBCASE1, SUBCASE2, and so on). As a result, when converting to VTK files, different working conditions should be correctly written to different subcases, but now All are written to subcase1-1, and the data is overwritten. The data of subcase2 is written to subcase1. image.png (view on web) https://github.com/SteveDoyle2/pyNastran/assets/63630092/878c52d5-2c86-4611-97e5-25809490827c https://github.com/SteveDoyle2/pyNastran/assets/63630092/878c52d5-2c86-4611-97e5-25809490827c image.png (view on web) https://github.com/SteveDoyle2/pyNastran/assets/63630092/2f3a2bc6-2159-4dce-a886-90703e49bc05 https://github.com/SteveDoyle2/pyNastran/assets/63630092/2f3a2bc6-2159-4dce-a886-90703e49bc05 As you can see from the two pictures above, after converting to VTK, two Subcases should be written, each with stress data of the triangular unit, but the generated VTK file only contains subcase1, and the storage in subcase1 is actually subcase2. data — Reply to this email directly, view it on GitHub <#780 <#780>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAICUWJW272CEUA5WZNVQHTY56LQBAVCNFSM6AAAAABGM6K22OVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2TAMRZGAYTQMA https://github.com/notifications/unsubscribe-auth/AAICUWJW272CEUA5WZNVQHTY56LQBAVCNFSM6AAAAABGM6K22OVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2TAMRZGAYTQMA . You are receiving this because you are subscribed to this thread.Message ID: @.> demo.zip https://github.com/SteveDoyle2/pyNastran/files/15031551/demo.zip this is a demo — Reply to this email directly, view it on GitHub <#780 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAICUWLPWWY5OBAW7MMQRDTY6BN3HAVCNFSM6AAAAABGM6K22OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRVGUYTEMZZGE . You are receiving this because you commented.Message ID: @.>

Hello, gentleman, after I completed the VTK data output, I wanted to verify whether the data conversion was completed correctly. I found that the original data and the converted VTK file data did not correspond, just like the example in the picture below. , when comparing the stress data in the X direction, it was found that some of the stress values in the X direction in the converted VTK file were obtained from the upper surface, and some were obtained from the lower surface. I don’t understand why this is the case. image

SteveDoyle2 commented 4 months ago

I added icase to the tag, so it looks like you're not using the latest version.

Did you attach this case or is it a different one?

SteveDoyle2 commented 4 months ago

It should be clearer once you use the latest version. It corresponds to Absolute Principal Stress, which you can see if you look at the result in the gui. With the icase tag, it's easy to find that specific case.

karma0704 commented 4 months ago

It should be clearer once you use the latest version. It corresponds to Absolute Principal Stress, which you can see if you look at the result in the gui. With the icase tag, it's easy to find that specific case.

1.4.1?

SteveDoyle2 commented 4 months ago

you need to use the latest dev version

karma0704 commented 4 months ago

OK, Let me try!

karma0704 commented 4 months ago

Please forgive my presumption, because I adapted the python3.7.X version in version 1.4.1 and modified many places in the source code. Can you tell me which files you modified? This way I can directly synchronize only your updated files. Thank you so much。

SteveDoyle2 commented 4 months ago

There were some gui files and Nastran_to_vtk. You can look at the git log, but python 3.7 is ancient, so I strongly suggest you upgrade. It’s really not that much of a change.

On Fri, Apr 26, 2024 at 12:24 AM karma0704 @.***> wrote:

Please forgive my presumption, because I adapted the python3.7.X version in version 1.4.1 and modified many places in the source code. Can you tell me which files you modified? This way I can directly synchronize only your updated files. Thank you so much。

— Reply to this email directly, view it on GitHub https://github.com/SteveDoyle2/pyNastran/issues/780#issuecomment-2078787202, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAICUWPTARP4NOJPM5MZK3LY7H6LTAVCNFSM6AAAAABGM6K22OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZYG44DOMRQGI . You are receiving this because you commented.Message ID: @.***>