NASTRAN file format question

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
chennes
Veteran
Posts: 3885
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: NASTRAN file format question

Post by chennes »

aerospaceweeb wrote: Sat Oct 02, 2021 9:13 pm Another MASSIVE problem is that FreeCAD can't import something, and then export it without changing it in an unpredictable way.
Namely, FreeCAD changes the IDs of every single object in the mesh when it imports it, and then changes the IDs again, in a way I don't fully understand, while exporting it.
The Mesh WB doesn't view the import/export process as an attempt to "edit" a given mesh file -- on import it is throwing away a tremendous amount of data when reading a NASTRAN file, and then it's converting any QUAD4 elements into triangles. Further, when you edit a mesh in FreeCAD's Mesh WB, no particular attempt is made to preserve the original node numbering, because to MeshWB that's not an important part of the mesh. So an exported NASTRAN mesh from MeshWB is unlikely to bear much resemblance to the original imported mesh, even if no changes are made to it. And if you've edited the mesh, it's going to be completely different.

These problems are not insurmountable, but they aren't trivial, either. FreeCAD is designed to be sort of "file-format-agnostic" -- it's not clear that the Mesh WB is the place to code in special handling for something like a NASTRAN file -- to me that feels more like something that should happen in Fem.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
aerospaceweeb
Posts: 118
Joined: Fri Apr 09, 2021 3:26 am

Re: NASTRAN file format question

Post by aerospaceweeb »

I wholeheartedly agree with you Chennes.

I think that's completely reasonable, and I hope to assist in dealing with this problem in the FEM workbench as best I can.
User avatar
johnwang
Veteran
Posts: 1348
Joined: Sun Jan 27, 2019 12:41 am

Re: NASTRAN file format question

Post by johnwang »

chennes wrote: Sun Oct 03, 2021 4:00 pm it's converting any QUAD4 elements into triangles. .
Yes.
mesh_hole3.jpg
mesh_hole3.jpg (46.85 KiB) Viewed 3354 times
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: NASTRAN file format question

Post by sgrogan »

chennes wrote: Fri Sep 24, 2021 7:24 pm No noise at all, it's an important concern -- keep doing what you do, there are lots of things to keep tabs on!
I get a self-test failure(s) when running from an INSTALLed Windows project.

Code: Select all

    m = Mesh.read(f"{self.test_dir}/NASTRAN_Test_GRID_CTRIA3.bdf")
RuntimeError: File does not exist: C:/SoftwareProjects/FreeCAD-testinstall-12.5.4/Mod\Mesh\App\TestData/NASTRAN_Test_GRID_CTRIA3.bdf
The .bsd file(s) are installed in ...MOD/Mesh/Data
A fix could be to install them in ...MOD/Mesh/App/TestData like in the build dir, but is this the best place?
"fight the good fight"
User avatar
chennes
Veteran
Posts: 3885
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: NASTRAN file format question

Post by chennes »

Sorry, that's my mistake -- it looks like I messed up the INSTALL target in the cMake file.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: NASTRAN file format question

Post by sgrogan »

chennes wrote: Mon Oct 11, 2021 9:19 pm Sorry, that's my mistake -- it looks like I messed up the INSTALL target in the cMake file.
No worries, but where best to install test files?
I don't know if we have a convention?
"fight the good fight"
User avatar
chennes
Veteran
Posts: 3885
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: NASTRAN file format question

Post by chennes »

As I recall I modeled this path originally on the OpenSCAD WB, since that's the one I was most familiar with. I don't actually feel strongly about it, if you have a suggestion.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: NASTRAN file format question

Post by sgrogan »

I don't have any strong feelings. Like you, just looking for consistency.
so Mod/Mesh/MeshTest/app ?
"fight the good fight"
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: NASTRAN file format question

Post by Kunda1 »

Using the latest FreeCAD snap edge (nightly) and latest AppImage
When i run the FreeCAD self test, I get the following issues:

Code: Select all

RuntimeError: File does not exist: /snap/freecad-ppd/90/usr/Mod/Mesh/App/TestData/NASTRAN_Test_GRID_CTRIA3.bdf
RuntimeError: File does not exist: /snap/freecad-ppd/90/usr/Mod/Mesh/App/TestData/NASTRAN_Test_Delimited_GRID_CQUAD4.bdf
RuntimeError: File does not exist: /snap/freecad-ppd/90/usr/Mod/Mesh/App/TestData/NASTRAN_Test_GRID_CQUAD4.bdf
RuntimeError: File does not exist: /snap/freecad-ppd/90/usr/Mod/Mesh/App/TestData/NASTRAN_Test_GRIDSTAR_CQUAD4.bdf

Code: Select all

OS: Ubuntu Core 20 (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.26658 (Git)
Build type: Release
Branch: master
Hash: 86ee738dff708f8cb54ac1a4ea39092092350ddf
Python version: 3.8.10
Qt version: 5.15.3
Coin version: 4.0.0
OCC version: 7.5.2
Locale: English/United States (en_US)

OS: Manjaro Linux (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.26651 (Git) AppImage
Build type: Release
Branch: (HEAD detached at d357d52)
Hash: d357d524d97db884b9bb562415e6b6d782ec02b4
Python version: 3.9.7
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: English/United States (en_US)
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
chennes
Veteran
Posts: 3885
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: NASTRAN file format question

Post by chennes »

Sorry, this completely fell off my radar (obviously). I still don't know where those files are supposed to go, though.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Post Reply