Personal tools
You are here: Home Forum How to use Salome? Renumbering mesh elements

Renumbering mesh elements

Up to How to use Salome?

Renumbering mesh elements

Posted by Bilquis Mohamodhosen at March 16. 2016

Hi all!

 

I am currently trying to renumber the elements in my mesh in the order I want to. The simplest example I can give is:

 

I have a cube with 125 hexahedral  elements. I want to renumber all elements from 1 to 100, which is currently not done in Salome as it numbers the elements in great disorder

, and not even starting from 1.

 

I have tried the 'renumbering' option in the GUI but doesn't work. Even the scripted command is useless. Any help or idea would be most welcome.

 

Thank you.

 

Bilquis

Re: Renumbering mesh elements

Posted by Saint Michael at March 16. 2016

Hi Bilquis

If you generated hexahedrons using "Hexahedron (ijk)" algorithm, then hexahedrons are in a good order (see the image) but since order or mesh generation is such that first mesh segments are created, then quadrangles on surfaces are created, and then hexahedrons are created, hence first numbers are used by segments and quadrangles.

So, to get hexahedra numbered from 1 you can remove all segments and quadrangles (as I did to create the image). If you need the segments and quadrangles, you can re-create them using Modification > Create Boundary Elements. They will take numbers after those used by hexahedra.

St.Michael

Re: Renumbering mesh elements

Posted by Bilquis Mohamodhosen at March 17. 2016

Hi St. Michael,When you actualy say remove all segments and quadrangles, at which step is that done? Because during the mesh creation I obviously cannot as there will be missing information to create the desired mesh. And if it is after the mesh creation, I cannot find the option to do it. I can only choose not to display the numbering from faces and edges, and in that case, only the volumes are displayed and I get what is shown in the image I have attached. (not sure if image appears correctly)

 

Attachments

Re: Renumbering mesh elements

Posted by Saint Michael at March 17. 2016
When you actualy say remove all segments and quadrangles, at which step is that done? And if it is after the mesh creation, I cannot find the option to do it.

I removed segments and quadrangles after meshing, using Modifications > Remove > Elements with filter( Geometry Type != Hexahedron ).

St.Michael

Re: Renumbering mesh elements

Posted by Bilquis Mohamodhosen at March 17. 2016

Actually the end application would be in this sense:

I have a model made of, say 4 cubic boxes. Therefore I will create 4 groups of volume (each box is a group of volume). Each cubic box is meshed into, say 125 hexahedra, hence a total of 500 hexa. What I want to do is number the hexahedra from the first two cubic boxes orderly from 1 to 250, and leave the rest to be numbered on its own. Therefore I want to choose how i renumber the elements of some groups of volume.

Is it possible with Salome? I will need to script the operation so that it can be used for different models though.

Re: Renumbering mesh elements

Posted by Saint Michael at March 17. 2016

To get that, using the approach I proposed, you need that the two first boxes be meshed before the other boxes. I see two easy ways to assure this meshing order:

1) When you create your geom model, pass the two first boxes before the others into the operation joining them: MakeCompount or Partition or ...

2) In SMESH:
 - do not assign Hexahedron algo to the mesh,
 - create a sub-mesh on the first box, with Hexahedron algo, compute the mesh,
 - create a sub-mesh on the second box, with Hexahedron algo, compute the mesh,
 - assign Hexahedron algo to the mesh, compute the mesh.

St.Michael

Re: Renumbering mesh elements

Posted by Bilquis Mohamodhosen at March 17. 2016

So I followed the steps, but the results is good, except that I still cannot get the numbering of the elements of the two first boxes chosen to be continuous in one sequence. The fact is that when I perform the last step of the SMESH (even after having computed the 2 sub-meshes beforehand), it still re-orders all the elements altogether.

 

In the picture I have attached, I have 4 cubes, each meshed hexahedrally into 8 elements (32 elements in all)

.

I want the elements of the cubes outlined in white to be continuous (e.g 1 - 16).

Attachments

Re: Renumbering mesh elements

Posted by Saint Michael at March 17. 2016

I got it w/o problems. Try dump.py attached.

St.Michael

Attachments

Re: Renumbering mesh elements

Posted by Timo Siltala at December 30. 2016

Hi St.Michael,

I have a related problem: importing several STEP geometries in arbitrary order and meshing them so that the numbering is totally continuous needs some effort but is possible. Problem is that solver requires all volume elements to be at the beginning of numbers, otherways it renumbers and tracking any issues from analysis become very difficult. Better keep the same numbering through the entire process. Therefore I would like to elements numbered in certain order (volume, shells, contacts etc). I have not figured out how to rearrange element numbering in Salome. All elements to be exported are arranged to groups.

I assume Salome internal numbering comes from the algorithms and order of their usage but is it possible to change the order afterwards? It seems impossible to affect the situation with any other tricks.

Timo

Re: Renumbering mesh elements

Posted by Saint Michael at December 30. 2016

Hi Timo

It's possible to remove faces and segments from the mesh and re-create them using Modification > Create boundary elements > 2D from 3D. As a result volumes precede faces. A drawback is that faces generated on surfaces shared by solids are lost. To re-create such 2D elements it's necessary to apply Create boundary elements to a group of volumes of a solid.

St.Michael

Re: Renumbering mesh elements

Posted by Timo Siltala at December 30. 2016

Ok, thanks. This makes quite a lot of additional work as the necessary boundaries are normally extracted from the meshes.

Thinking slightly deeper, elements are just chained instances of element class objects. It might be possible to make a piece of code which rechain them into wanted order. Would that already do the trick or should I also manipulate their internal data? That might be impossible if ID:s are private data.

Timo

Re: Renumbering mesh elements

Posted by Saint Michael at December 30. 2016

If you export a mesh using your own code, you can change the order of export, else It seems impossible.

St.Michael

Re: Renumbering mesh elements

Posted by Timo Siltala at January 03. 2017

Thanks St.Michael,

that's just what I have done. However I am keeping the element numbers they have got in meshing to enable tracking of problematic things in the analysis. Salome seems to be quite efficient in splitting, slicing etc. the model. Therefore I am reluctant to renumber in export, I'd rather rearrange the elements in storage and keep their numbers in export. Do you think it is possible to do that by only rechaining the pointers or does that generate other problems, e.g. am I going to mix for example the  references between elements and geometrical items?

Timo

Re: Renumbering mesh elements

Posted by Saint Michael at January 09. 2017

Hi Timo

Do you mean you want to write a low-level code to renumber elements and ask how?

St.Michael

Powered by Ploneboard
Document Actions