Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when reading form an OP2 Contaning CTRIA3 and CTRIA6 elements #740

Open
gornezo opened this issue Aug 18, 2023 · 11 comments
Open

Issue when reading form an OP2 Contaning CTRIA3 and CTRIA6 elements #740

gornezo opened this issue Aug 18, 2023 · 11 comments

Comments

@gornezo
Copy link

gornezo commented Aug 18, 2023

Dear community,

I have encountered an isssue when trying to load the results of an OP2 model containing both CTRIA3 and CTRIA6 results. Stress output is set to CORNER, thus this forces the op2 reader to load the results of the CTRIA3 in the same directory 'ctria6_stress' that would be normally used by the CTRIA6 results. I believe this is what causes the issue.

Here is an extract of my code:

           # read in model
            model = OP2(debug=False)
            model.read_op2(file_)

           #load results dictionaries
            stress_ctria3 = model.ctria3_stress
            stress_ctria6 = model.ctria6_stress

The obtained error message is:
File "C:\Program Files\Python39\lib\site-packages\pyNastran\op2\tables\oes_stressStrain\oes.py", line 5347, in _oes_cquad4_144
obj.data[obj.itime, istart:iend, :] = results
ValueError: could not broadcast input array from shape (712,8) into shape (3800,8)

In ,my test model I have used 89 CTRIA3 Elements -> 712 entries (4nlayersnlements). Then the CTRIA6 data containing 475 CTRIA6 elements -> 3800 entries (4nlayersnlements) is attempted to be written.
Strangely (or maybe because im not understanding something), the itime value when trying to write the CTRIA6 elements is set to 1 instead of 0, which causes the sizing of the data container not to be updated.
If I update the code in the oes.py file line 5233 :
from:

if obj.itime == 0:

to:

if obj.itime in [0, 1]:

then the program will run, but the content of the ctria6_stress dictionary will only provide the values of the CTRIA6 elements and not the CTRIA3.

My calculation is a linear calculation, thus the time increment of 1 does not seem logical to me. Is this behaviour intended?
Then, it remains the question, how can I get results for the case where I have this mixed elements? it seems to work fine for CQUAD4 and CQUAD8 mixture.

I appreciate your help and of course thank you for all the hard work set into this amazing library!

Kind regards,
Chris

@SteveDoyle2
Copy link
Owner

SteveDoyle2 commented Aug 18, 2023 via email

@gornezo
Copy link
Author

gornezo commented Aug 19, 2023

Hi,

I have attached a zip file with my own small example. There you have a combination of CTRIA3 and CTRIA6 elements. I am wirking with OPTISTRUCT, thus the input file is a .fem file. I hope the issue is not in the OPTISTRUCT solver internal association of the elments, but please let me know what your findings are.

Thanks for the quick reply. I really appreciate it.
2ndOrder_CTRIA_Mixed.zip

@SteveDoyle2
Copy link
Owner

SteveDoyle2 commented Aug 19, 2023 via email

@gornezo
Copy link
Author

gornezo commented Aug 19, 2023

Hello Steve,

Apologies, I did pack the wrong model, this was my test with CQUAD elements which is working.

For completeness, this is a 4-Element model -> 1 CTRIA3, 1 CTRIA6, 1 CQUAD4, 1 CQUAD8.

I would expect the following code to fill in with 1 element each separate dictionary:

           # read in model (quads and trias)
            model = OP2(debug=False)
            model.read_op2(file_)

            stress_quads4 = model.cquad4_stress
            stress_quads8 = model.cquad8_stress
            stress_trias3 = model.ctria3_stress
            stress_trias6 = model.ctria6_stress

Thanks again.

2ndOrder.zip

@SteveDoyle2
Copy link
Owner

SteveDoyle2 commented Aug 19, 2023 via email

@gornezo
Copy link
Author

gornezo commented Aug 19, 2023

I'm using Optistruct 2022.2 so I have no access to NASTRAN. Im getting you a bdf file so you can run it and produce the f06?
Let me know what comes out.
2ndOrderModel_bdf.zip

@SteveDoyle2
Copy link
Owner

SteveDoyle2 commented Aug 19, 2023 via email

@gornezo
Copy link
Author

gornezo commented Aug 20, 2023 via email

@SteveDoyle2
Copy link
Owner

SteveDoyle2 commented Aug 20, 2023

The main ascii output file (I stuck a .txt on it for github).
static_elements.f06.txt

It has tables like this that describe the output
image

It's slow to parse the file, but it's really easy to compare to what I see in the binary data.

@gornezo
Copy link
Author

gornezo commented Aug 20, 2023

Hi Steve,

Ok, This should help. In the new zip you can find the .fem, .op2 a .pch (NASTRAN punch result format) and additionally the OPTI style ASCII format in the .strs file.
2ndOrder.zip

@SteveDoyle2
Copy link
Owner

looks like Optistruct writes the CTRIA3 as a CTRIA6, but the CQUAD4 doesn't have that issue.

Not sure...I need to think about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants