NASTRAN file format question

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
johnwang
Veteran
Posts: 1345
Joined: Sun Jan 27, 2019 12:41 am

Re: NASTRAN file format question

Post by johnwang »

chennes wrote: Mon Sep 20, 2021 2:03 pm Yes, the Mesh WB is strange
Played with it a little. Found out a Mesh is the surface of a solid. Like the STL file. So not too much use for FEM.

Mesh could exports to a Nastran nas/dbf file. that's cool.

When you import a 3D STL, the model could be shown up. But if import a 2d Nastran mesh, nothing show up. Could STL save a 2d plane mesh?
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: NASTRAN file format question

Post by chennes »

johnwang wrote: Wed Sep 22, 2021 12:18 am But if import a 2d Nastran mesh, nothing show up.
Do you have an example file I could look at? I think this should be working.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
johnwang
Veteran
Posts: 1345
Joined: Sun Jan 27, 2019 12:41 am

Re: NASTRAN file format question

Post by johnwang »

chennes wrote: Wed Sep 22, 2021 12:43 am
Wire (Meshed).nas works. It is exported by Mesh. It uses TRIA3

Hinge.bdf nothing show up. But got the nodes, edges and faces imported. It uses QUAD4.

Please remove the txt in file names.
Wire (Meshed).nas.txt
(7.66 KiB) Downloaded 69 times
Hinge.bdf.txt
(19.53 KiB) Downloaded 55 times
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: NASTRAN file format question

Post by chennes »

Thanks, that's very helpful. The second file is failing because the Mesh NASTRAN reader fails to stop at the end of the 8-char limit for the numbers, and just starts chewing into the next one. Have you ever seen a version of the NASTRAN format that space-delimits the numbers instead of using the column-based format? I mean, that's obviously not really NASTRAN anymore, but maybe the original writer of this Mesh code had something a little different.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
johnwang
Veteran
Posts: 1345
Joined: Sun Jan 27, 2019 12:41 am

Re: NASTRAN file format question

Post by johnwang »

chennes wrote: Wed Sep 22, 2021 3:52 am Have you ever seen a version of the NASTRAN format that space-delimits the numbers instead of using the column-based format?
I am still new to NASTRAN. What I play with is Nastran-95. I think it is always Fixed-Field: 1-8 for variable 1, 9-16 for variable 2,....
Free field with delimit was new. 95 supports , delimit.
Maybe I used the whole 8 digits, but the code need a space. I'll make one with space.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
johnwang
Veteran
Posts: 1345
Joined: Sun Jan 27, 2019 12:41 am

Re: NASTRAN file format question

Post by johnwang »

This one works. It includes only one quad shape. Must has a space in between.

But why it says 5 edges? 2 faces maybe it still think about a 3d soild.
Quad4E.bdf.txt
(501 Bytes) Downloaded 58 times
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
johnwang
Veteran
Posts: 1345
Joined: Sun Jan 27, 2019 12:41 am

Re: NASTRAN file format question

Post by johnwang »

chennes wrote: Wed Sep 22, 2021 3:52 am The second file is failing because the Mesh NASTRAN reader fails to stop at the end of the 8-char limit for the numbers,
Do you have ways to check if it fails? If fail, change to read the 10 words of 8-char.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: NASTRAN file format question

Post by chennes »

johnwang wrote: Wed Sep 22, 2021 5:49 am Do you have ways to check if it fails? If fail, change to read the 10 words of 8-char.
Yes, I think so -- that sounds like interesting code to write, I'll work on it today.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: NASTRAN file format question

Post by chennes »

OK, I added the code to support non-delimited 8-char-width GRID element in this PR:
https://github.com/FreeCAD/FreeCAD/pull/5052
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: NASTRAN file format question

Post by chennes »

I think it would be a good idea to add a unit test for this new format support -- would it be OK for me to include Hinge.bdf in our repo?
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Post Reply