SteveDoyle2 / pyNastran

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

PBEAM illegal data due to missing last empty line #757

Closed ChristopheBozec closed 6 months ago

ChristopheBozec commented 6 months ago

Hello all,

When exporting PBEAM properties, the last line containing Ci, Di, Ei, Fi should be written even if empty, as it is causing illegal data error in Nastran (2013.1.0)

from pyNastran.bdf.bdf import BDF
nastran_model = BDF()
nastran_model.add_pbeam(1001, 1, [0., 1.], ['YES', 'YES'], [10., 10.], [50., 50.], [55., 55.], [0., 0.], [30., 30.])
nastran_model.add_pbeam(1002, 1, [0., 1.], ['YES', 'YES'], [10., 10.], [50., 50.], [55., 55.], [0., 0.], [30., 30.])
nastran_model.write_bdf('output_test_pbeam.bdf', size=8)

The exported file contains:

$pyNastran: version=msc
$pyNastran: punch=True
$pyNastran: encoding=utf-8
$pyNastran: nnodes=0
$pyNastran: nelements=0
$PROPERTIES
PBEAM       1001       1     10.     50.     55.             30.
+
             YES      1.     10.     50.     55.             30.
PBEAM       1002       1     10.     50.     55.             30.
+
             YES      1.     10.     50.     55.             30.

By correcting it by hand to:

PBEAM       1001       1     10.     50.     55.             30.
+
             YES      1.     10.     50.     55.             30.
+
PBEAM       1002       1     10.     50.     55.             30.
+
             YES      1.     10.     50.     55.             30.
+

It then runs correctly.

SteveDoyle2 commented 6 months ago

Why not just use a single line?

On Tue, Feb 20, 2024 at 09:03 ChristopheBozec @.***> wrote:

Hello all,

When exporting PBEAM properties, the last line containing Ci, Di, Ei, Fi should be written even if empty, as it is causing illegal data error in Nastran (2013.1.0)

from pyNastran.bdf.bdf import BDF nastran_model = BDF() nastran_model.add_pbeam(1001, 1, [0., 1.], ['YES', 'YES'], [10., 10.], [50., 50.], [55., 55.], [0., 0.], [30., 30.]) nastran_model.add_pbeam(1002, 1, [0., 1.], ['YES', 'YES'], [10., 10.], [50., 50.], [55., 55.], [0., 0.], [30., 30.]) nastran_model.write_bdf('output_test_pbeam.bdf', size=8)

The exported file contains:

$pyNastran: version=msc $pyNastran: punch=True $pyNastran: encoding=utf-8 $pyNastran: nnodes=0 $pyNastran: nelements=0 $PROPERTIES PBEAM 1001 1 10. 50. 55. 30. + YES 1. 10. 50. 55. 30. PBEAM 1002 1 10. 50. 55. 30. + YES 1. 10. 50. 55. 30.

By correcting it by hand to:

PBEAM 1001 1 10. 50. 55. 30. + YES 1. 10. 50. 55. 30. + PBEAM 1002 1 10. 50. 55. 30. + YES 1. 10. 50. 55. 30. +

It then runs correctly.

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

ChristopheBozec commented 6 months ago

I am guessing you mean this ?

PBEAM       1002       1     10.     50.     55.             30.
             YES      1.     10.     50.     55.             30.

I didn't try, this should work as well. However, I am wondering why the continuation is written by default for the first empty line and not the second ? Since I defined no data for either.

SteveDoyle2 commented 6 months ago

Oh…I didn’t catch that. That definitely doesn’t make sense. I’ll take a look.

On Tue, Feb 20, 2024 at 10:48 ChristopheBozec @.***> wrote:

I am guessing you mean this ?

PBEAM 1002 1 10. 50. 55. 30. YES 1. 10. 50. 55. 30.

I didn't try, this should work as well. However, I am wondering why the continuation is written by default for the first empty line and not the second ? Since I defined no data for either.

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

SteveDoyle2 commented 6 months ago

The continuation line is required because that line defines C1(A)-F2(A).

[image: image.png] Why are you adding a continuation line at the end and why 1 and not 2? All of those values on the last 2 lines have defaults.

On Tue, Feb 20, 2024 at 10:56 AM Steven Doyle @.***> wrote:

Oh…I didn’t catch that. That definitely doesn’t make sense. I’ll take a look.

On Tue, Feb 20, 2024 at 10:48 ChristopheBozec @.***> wrote:

I am guessing you mean this ?

PBEAM 1002 1 10. 50. 55. 30. YES 1. 10. 50. 55. 30.

I didn't try, this should work as well. However, I am wondering why the continuation is written by default for the first empty line and not the second ? Since I defined no data for either.

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

ChristopheBozec commented 6 months ago

In that case, both continuation lines are necessary, the first one for C1(A)-F2(A) (this one is ok, it's always there) and the second for C1(i)-F2(i) (this one is missing in the export).

SteveDoyle2 commented 6 months ago

Weird...seems like they just have a bad parser. Anyways, it should be fixed now, which you can get if you update. You can also just set C1(B) to be 1e-16 or whatever.