Pyramid element with ElmerGrid

Mesh generators, CAD programs, and other tools
sato
Posts: 13
Joined: 09 May 2020, 05:23
Antispam: Yes

Pyramid element with ElmerGrid

Post by sato »

Dear all,


I tried to convert .unv file (I made this by Salome-meca) to Elmer format using ElmerGrid.

But after conversion, some elements were lost, and they seemed to be pyramid elements.

ElmerGrid cannot convert pyramid element? If not, could anybody tell me the alternative tool?


Regards,
Satoshi
vencels
Posts: 63
Joined: 20 Sep 2016, 17:05
Antispam: Yes
Location: Latvia
Contact:

Re: Pyramid element with ElmerGrid

Post by vencels »

kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Pyramid element with ElmerGrid

Post by kevinarden »

Issue is that salome does not export pyramid elements to a unv file, the salomeToElmer script will.
Attachments
pyramid.png
pyramid.png (20.25 KiB) Viewed 6096 times
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Pyramid element with ElmerGrid

Post by raback »

Hi,

Great script by Juris! Also has support for entity names. This was news also to me or maybe I had just forgotten about it...

-Peter
sato
Posts: 13
Joined: 09 May 2020, 05:23
Antispam: Yes

Re: Pyramid element with ElmerGrid

Post by sato »

Thank you very much for so helpful script. It works!
sato
Posts: 13
Joined: 09 May 2020, 05:23
Antispam: Yes

Re: Pyramid element with ElmerGrid

Post by sato »

I also tried to convert quadratic element.

Taking a quick look at salomeToElmer.py, it didn't have names of quadratic elements in elemTypeNames dict. (original Line 96)
So I simply added quadratic element name items.

Code: Select all

    elemTypeNames = {'202': 'Entity_Edge', '303': 'Entity_Triangle', \
                     '203': 'Entity_Quad_Edge', '306': 'Entity_Quad_Triangle', \
                     '404': 'Entity_Quadrangle', '504': 'Entity_Tetra', \
                     '408': 'Entity_Quad_Quadrangle', '510': 'Entity_Quad_Tetra', \
                     '605': 'Entity_Pyramid', '706': 'Entity_Penta', \
                     '613': 'Entity_Quad_Pyramid', '715': 'Entity_Quad_Penta', \
                     '808': 'Entity_Hexa', \
                     '820': 'Entity_Quad_Hexa'}
But the program resulted in index error.
I found this error came from the failure in getting elements by point.(original Line 187)

Code: Select all

        parents = mesh.FindElementsByPoint( x,y,z, bodyType )
This array was empty in some points. Probably some points belong to no volume elements. But I have no idea to modify so far.
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Pyramid element with ElmerGrid

Post by raback »

Hi

The annoying thing is that every FEM project has given different numbering to local nodes in elements. When you're working with linear elements it is more difficult to go wrong. In fact the linear elements have same node numbering. For quadratic numbering look at UnvToElmerIndx subroutine in:

https://github.com/ElmerCSC/elmerfem/bl ... emfilein.c

Another annoying thing that the crappy UNV file save point clouds - not boundary elements. So one has to find the elements using the points.

So I cannot much more help. For simply finding the elements you could use just the linear basis. However, you need to consider the ordering of local nodes carefully in the Python routine since otherwise the elements will be totally tangled.

If you start coding I suggest first deal with the bulk elements only and when ordering is ok you may have better luck with the search.

-Peter
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Pyramid element with ElmerGrid

Post by kevinarden »

having written translation programs for FEA codes I found there is no standard for quadratic elements.
Attachments
node order.png
(60.96 KiB) Not downloaded yet
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Pyramid element with ElmerGrid

Post by raback »

kevinarden wrote: 09 Jun 2020, 20:25 having written translation programs for FEA codes I found there is no standard for quadratic elements.
And as if that was not enough it is often very difficult to find what ordering is being used. Oh how many times I've looked at just a few elements trying to figure it out. To make things more interesting some codes have also degenerated elements that should be detected somehow. Like tetrahedrons can be expressed as degenerated hexahedron. I never figured out why...

-Peter
vencels
Posts: 63
Joined: 20 Sep 2016, 17:05
Antispam: Yes
Location: Latvia
Contact:

Re: Pyramid element with ElmerGrid

Post by vencels »

sato,

can you try exporting linear elements form Salome and then calling

Code: Select all

ElmerGrid 2 2 -increase .............
ElmerGrid manual says that the option
-increase : increase element order from linear to quadratic
The original SalomeToElmer script cannot export quadratic elements. If you can figure it out that would be very useful! I will add changes and list you as a co-author.
Post Reply