Page 1 of 2

Pyramid element with ElmerGrid

Posted: 08 Jun 2020, 09:06
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

Re: Pyramid element with ElmerGrid

Posted: 08 Jun 2020, 09:16
by vencels

Re: Pyramid element with ElmerGrid

Posted: 08 Jun 2020, 11:31
by kevinarden
Issue is that salome does not export pyramid elements to a unv file, the salomeToElmer script will.

Re: Pyramid element with ElmerGrid

Posted: 08 Jun 2020, 12:05
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

Re: Pyramid element with ElmerGrid

Posted: 08 Jun 2020, 13:20
by sato
Thank you very much for so helpful script. It works!

Re: Pyramid element with ElmerGrid

Posted: 09 Jun 2020, 13:43
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.

Re: Pyramid element with ElmerGrid

Posted: 09 Jun 2020, 15:33
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

Re: Pyramid element with ElmerGrid

Posted: 09 Jun 2020, 20:25
by kevinarden
having written translation programs for FEA codes I found there is no standard for quadratic elements.

Re: Pyramid element with ElmerGrid

Posted: 09 Jun 2020, 21:11
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

Re: Pyramid element with ElmerGrid

Posted: 10 Jun 2020, 09:44
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.