Solver for Mystran

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Solver for Mystran

Post by bernd »

aerospaceweeb wrote: Mon Jul 26, 2021 12:23 am I see. It all makes sense now.

I didn't know Salome uses inverse normals that way.
The normals point outside of the tetrahedron no matter which mesh system is used. AFAIK for all thy point outside of the solid. I would rather say Salome SMESH gos counterclocside whereas Nastran goes clockwise with their nodes in each face.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Solver for Mystran

Post by bernd »

Thuis is what I would came up with ...

# N1, N3, N2, N4, N7, N6, N5, N8, N10, N9

Mesh.py
(22.17 KiB) Downloaded 44 times

Mesh.bdf.txt
(24.61 KiB) Downloaded 47 times

screen.png
screen.png (76.09 KiB) Viewed 2090 times
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Solver for Mystran

Post by bernd »

With this the reader of John has inverted faces on importing results. John any remarks on this from your side?

Bernd
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Solver for Mystran

Post by bernd »

We need some result reader. The one from hfcMystran is GPL3. As long as it is GPL3 we can not use the code in FreeCAD. I am evaluating other possibilities ...

https://github.com/SteveDoyle2/pyNastran/issues/651


cheers bernd
aerospaceweeb
Posts: 118
Joined: Fri Apr 09, 2021 3:26 am

Re: Solver for Mystran

Post by aerospaceweeb »

The results formats for Mystran are EXTREMELY easy to parse normally. ANS files and F06 files are quite easy to read, as are Neutral files, which are now fully supported, and are a default results format for FeMap, the extremely popular pre/post-processor.

What kind of reader do you need? I can probably help make something that works if we worked together to make a basic set of test models.

ALSO, don't tell anyone, but Steve is almost completely done adding OP2 support to mystran; at which point, reading that OP2 file using pyastran would be easy as pie.


EDIT_01: He has said that he's not "almost done" when he saw that I wrote this. He says there's plenty left to do. He's right. OP2 is an absolute monster of a file format.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Solver for Mystran

Post by bernd »

If a new solver is added to FreeCAD FEM, FreeCAD should read its results out of the box. No external module should be needed IMHO.


aerospaceweeb wrote: Tue Jul 27, 2021 2:57 am The results formats for Mystran are EXTREMELY easy to parse normally. ANS files and F06 files are quite easy to read, as are Neutral files, which are now fully supported, and are a default results format for FeMap, the extremely popular pre/post-processor.

What kind of reader do you need? I can probably help make something that works if we worked together to make a basic set of test models.

ALSO, don't tell anyone, but Steve is almost completely done adding OP2 support to mystran; at which point, reading that OP2 file using pyastran would be easy as pie.
the OP2 is a great option and hopefully we will use pyNastran OP2 for this. But this may take some time.

ATM IMHO best is to read the Neutral files into a FreeCAD result object. John has made a great module for this, but this module is GPL3. Thus we are not allowed to integrate it in FreeCAD which is GPL2. Either we stick to this external module (ATM it has some problems with tetra reading) or we would need to totally recode a Neutral reader. The later is a bad option. If we stick to it the user would need to install the hfcMystran to read Mystran results.

@John: How about you? What is your opinion on this?
mesheb82
Posts: 9
Joined: Tue Jul 27, 2021 4:18 am

Re: Solver for Mystran

Post by mesheb82 »

@bernd

A couple follow-ups on pyNastran...

Regarding, the inverted elements, that's just a Nastran requirement. In the add_tetra method (or 99% of the add_* methods), there is no check on creation, so you're allowed to create models with missing nodes or inverted elements. This is necessary because it allows you to load in invalid/degenerate elements and fix/remove them (e.g., you have a CTRIA3 with 2 unique node ids). It's also faster.

The validate() method may be called, which performs some type checking and is not required. Some classes use a special writer (e.g., the grid, ctetra), so you'll find out at write time if you have a node id that's a string/float. Typing is only enforced when reading from a file, which is used to speed it up (e.g., the field can be an integer or blank).

With pyNastran, there's a command line script called test_bdf that if you have a density on your MAT1 (isotropic material), you'd see that the total mass on the model is negative. Thanks to FEA magic, it's allowed to add negative mass (as long as the mass on a given node is positive), though negative volume is a whole different level of bad. That's not checked though. Allowing inverted elements is not a pyNastran error because you can fix it.

There is no calculation of Jacobians in pyNastran as so far it's not been needed. The GUI will show element quality metrics (taper_ratio, max_skew, aspect_ratio, min_theta, max_theta, dideal_theta, min_edge_length, max_warp, and area_ratio). All those are pretty standard except for area_ratio, which I find to be a better metric for taper (you project each pair of sides to calculate the area, so 4 areas for a quad, then take the (actual_area/min_area) and (max_area/actual area)).

Finally, you also mentioned about an example showing off the card usage. You're somewhat expected to have the Nastran QRG handy when you're using those add_grid or whatever methods. Additionally, pyNastran is not a mesher, so the only examples are small tests, so:
- https://github.com/SteveDoyle2/pyNastra ... _shells.py
- https://github.com/SteveDoyle2/pyNastra ... _solids.py
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Solver for Mystran

Post by bernd »

thanks for all the information
mesheb82 wrote: Wed Jul 28, 2021 7:03 pm The validate() method may be called, which performs some type checking and is not required. Some classes use a special writer (e.g., the grid, ctetra), so you'll find out at write time if you have a node id that's a string/float. Typing is only enforced when reading from a file, which is used to speed it up (e.g., the field can be an integer or blank).
good to know

mesheb82 wrote: Wed Jul 28, 2021 7:03 pm With pyNastran, there's a command line script called test_bdf that if you have a density on your MAT1 (isotropic material), you'd see that the total mass on the model is negative. Thanks to FEA magic, it's allowed to add negative mass (as long as the mass on a given node is positive), though negative volume is a whole different level of bad. That's not checked though. Allowing inverted elements is not a pyNastran error because you can fix it.
somehow cool

mesheb82 wrote: Wed Jul 28, 2021 7:03 pm There is no calculation of Jacobians in pyNastran as so far it's not been needed. The GUI will show element quality metrics (taper_ratio, max_skew, aspect_ratio, min_theta, max_theta, dideal_theta, min_edge_length, max_warp, and area_ratio). All those are pretty standard except for area_ratio, which I find to be a better metric for taper (you project each pair of sides to calculate the area, so 4 areas for a quad, then take the (actual_area/min_area) and (max_area/actual area)).
good to know

mesheb82 wrote: Wed Jul 28, 2021 7:03 pm Finally, you also mentioned about an example showing off the card usage. You're somewhat expected to have the Nastran QRG handy when you're using those add_grid or whatever methods. Additionally, pyNastran is not a mesher, so the only examples are small tests, so:
- https://github.com/SteveDoyle2/pyNastra ... _shells.py
- https://github.com/SteveDoyle2/pyNastra ... _solids.py
The time being I made my way through pyNastran bdf. I still do not know anything about OP2.. When I started I did neither knew pyNastran nor bdf file format, thus these examples would have been helpful if I would have known them. I was really really happy to have found this example https://pynastran-git.readthedocs.io/en ... t_bdf.html The example really helped a lot.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Solver for Mystran

Post by bernd »

The initial version of Mystran solver in in FreeCAD master. https://github.com/FreeCAD/FreeCAD/comp ... 01ec949525 It needs pyNastran to write the solver input. The pyNastran code used to create the bdf file is written too.

Start FreeCAD switch to FEM use Utilities Gui. Mystran hast a few examples already. They give correct results for me. Would be cool if some of you would give it a try and give some feedback about the generated pyNastran code. As you know I am still a newbie to pyNastran.


About Postprocessing: For reading the results hfcMystran has to be installed.
@John: Are you interested to see your NEUreader in FreeCAD master? The issue is still open: https://github.com/ceanwang/hfcMystran/issues/2
aerospaceweeb
Posts: 118
Joined: Fri Apr 09, 2021 3:26 am

Re: Solver for Mystran

Post by aerospaceweeb »

That looks very good Bernd!

Well done!

I'll try testing this out tonight.

- Aero
Post Reply