×

Notice

The forum is in read only mode.

FEA Inter-operability

  • phsieh2005
  • Topic Author
  • Visitor
  • Visitor
18 years 3 months ago #667 by phsieh2005
Replied by phsieh2005 on topic Re:FEA Inter-operability
Dear Admin:

After staring on the unv text files more, I think that elmer unv converter does not use the \"groups\" information. For different bodies, I think that the fourth number in the element section (that is 2412) specify which body this element belongs to, that is \"5\" in the following entry.

-1
2412
1 111 1 5 7 4
104 46 29 30

In salome, it cannot tell which element belongs to what (I think), so, the only way maybe to look in the \"groups\" section and change the 4th number according which group it belongs to.

phsieh2005
  • admin
  • Topic Author
  • Visitor
  • Visitor
18 years 3 months ago #670 by admin
Replied by admin on topic Re:FEA Inter-operability
Hi,

if you start \"python unv2ElmerUNV.py\" without arguments it will print some help message mentionning :

UNV2ElmerUNV: Convert UNV file from Salome to ELMER UNV mesh
usage: UNV2ElmerUNV unvfile prefix
what it does: read unvfile, create an internal FEM object structure
in memory and writes the prefix.unv file
As Salome does not write a color for finite elements, the different bodies
cannot be distinguished. To define bodies, you need to create element groups
called body1, body2 etc.. in Salome before you export the mesh.
Moreover all elements in groups named X_* will just be deleted before conversion
(usefull to delete all additionnal 1D & 2D elements created by Salome)
Finally, a dataset 164 (units) will be added, with default units in SI (m,N)...
Change the units in ELMER if your mesh is not in SI units.


So all you will need to do is to create element groups called body1, body2 etc... to define Bodies for ELMER (Elmer does not use the groups from UNV... but only the material assignments in dataset 2412).

Moreover, my apologize for unv2elmer.py, as it should not have been released now, because the code is not finished yet (does not create .boundary file, which is a quite complex task indeed).

I hope this will solve your problem.

PS: CAELinux beta 3a will be probably released today, with all the tools you need to do convert Salome-UNV files to OpenFOAM, Elmer and Calculix... (very \"young\" translators might need some testing & updates though)
  • phsieh2005
  • Topic Author
  • Visitor
  • Visitor
18 years 3 months ago #672 by phsieh2005
Replied by phsieh2005 on topic Re:FEA Inter-operability
Dear Admin:

Thanks a lot for all the great work (and hard work I believe)!

I am sorry that I am asking too much from you. But, I do not know python language (I do know MS VB though).
For unv2ElmerUNV.py, is it possible to add a small code to replace the material entry in 2412 base on the \"group\" information? I am considering doing this in VB, but, it may not be too helpful to the Elmer community because most people here use Linux.

I am willing to do testing of beta3a and its tools when it comes out. I use SuSE 10.1 64 bit OS, I had to install mandria 2006 to install Salome 3.2.1. A liveDVD will be wonderful.

phsieh2005
  • admin
  • Topic Author
  • Visitor
  • Visitor
18 years 3 months ago #673 by admin
Replied by admin on topic Re:FEA Inter-operability
Hi,

this is exactly what this code does:
1) get a list of elements in groups named \"body1\", \"body2\" etc..
2) for each element of each body assign a color id and material id that is equal to the body number.

So if you name all your groups with \"bodyXYZ\" scheme, you will get what you want.

I have developed this code very quickly in less than an afternoon, so it is by far not optimal yet. I was not intending to create a perfect code at the first try, but more to try to give a starting point to the community. At the moment, I am trying to prepare the release of beta 3 and then I could try to improve this unv2x code.

In the meantime, I think that if you know VB, you will probably learn python very quickly as it is a very simple language. The only thing to understand is the code structure (for, while loops, functions) and how to handle lists...
The simplest way to start learning python is to follow on of the great tutorial on www.python.org-
  • phsieh2005
  • Topic Author
  • Visitor
  • Visitor
18 years 3 months ago #674 by phsieh2005
Replied by phsieh2005 on topic Re:FEA Inter-operability
Dear Admin:

Thanks a lot! I got it to what I wanted now.
I saved the group name to something like \"heater\" \"insulator\". Now, I realized that it needs to be \"body1\" \"body2\" for this python code to work.

I only do 3D elements, one thing I noticed is that somehow elmer does not like the face (2d) elements in the unv file (3 nodes). It somehow mess up the body info in elmer. I deleted all the 2D elements in the unv file before importing into elmer. It seemed fine. The boundary elements can be created within elmer.

phsieh2005
More
18 years 3 months ago #699 by Joël Cugnoni
Replied by Joël Cugnoni on topic Re:FEA Inter-operability
Hi,

unv2ElmerUnv.py can also remove undesired elements: all you need to do is to create groups called X_* (X_face1 for example) and the mesh converter should delete these elements directly.

I have not tested this converter much at the moment, but in 3D, I noticed some serious performance problem. I have allready determined which loop is in cause and will provide an optimized version soon.

Joël Cugnoni - a.k.a admin
www.caelinux.com
Moderators: catux
Time to create page: 0.170 seconds
Powered by Kunena Forum