Impossible to select bodies

The graphical user interface of Elmer
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Impossible to select bodies

Post by kevinarden »

ElmerGrid creates mesh.names as a reference file, it creates entities.sif so it can be copied into the sif file. You can use the names of the bodies and boundaries to assign properties and conditions (not in the GUI, but in the file. It only does this if you have physical groups.
Roland
Posts: 226
Joined: 12 Apr 2018, 11:29
Antispam: Yes

Re: Impossible to select bodies

Post by Roland »

Hi,
Thanks to you for your answers.
I knew that in Gmsh you can create physical groups but, after a few tests I believed that this don't work in Elmer, meaning that Elmer does not recognize the physical groups. I will try this again and also take a look at your files, Kevin, and keep you informed.
But as I said it, until a few days ago, I don't remember having problems with selecting bodies in my Elmer models.... This is why it puzzles me a bit: why have I this problem only since a few days (I didn't change the Elmer version)?
We keep us informed.
Roland
Roland
Posts: 226
Joined: 12 Apr 2018, 11:29
Antispam: Yes

Re: Impossible to select bodies

Post by Roland »

Hi Kevin,
I just tried your cube.geo file with the physical groups.
Unfortunately the problem remains the same: impossible to select the 3 inner cubes (which are not red highlighted when clicking on "body property 1,2,3" in the left window), only the outer cube becomes red when clicking on "body property 4" .
What is your opinion about that? As former said, I don't understand why we have this problem now and I am sure that there was no such problem a few days (or weeks) ago when I made for instance the "EM cold crucible" 3D model for which each body could be selected and red highlighted without any problem....
Perhaps, Peter, could you give your opinion about that?
Thanks in advance.
Roland
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Impossible to select bodies

Post by kevinarden »

Physical groups work in Elmer, in that they create bodies and boundaries with names that can be used in ElmerSolver. The select and display is is an ElmerGUI problem graphical problem only, and only in 3D. ElmerGUI uses the boundary surface element to highlight the body, and not the body elements itself. When the boundary has two parent elements ElmerGUI does not know which surface to highlight when the body is selected. The bodies can still be used in ElmerGUI and ElmerSolver, then only thing that is not functioning is the highlighting.

I imagine the ElmerGUI code could be changed to highlight any surface attached to a body, whether or not that surface has two parents or not.
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Impossible to select bodies

Post by kevinarden »

You can see in this example of 3D crucible the body highlighting appears to work because there is a plane of symmetry. The surfaces on the plane highlights when the body is selected because there is only 1 parent. But if you hide the outer body you can see that the internal boundaries do not highlight when the body is selected because the boundary has two parents.
In the case of the cube the internal cube is completely inside the outer box there for all of its surfaces have 2 parents.
plane.png
(106.53 KiB) Not downloaded yet
hidden.png
hidden.png (67.58 KiB) Viewed 1580 times
Roland
Posts: 226
Joined: 12 Apr 2018, 11:29
Antispam: Yes

Re: Impossible to select bodies

Post by Roland »

Hi Kevin,
Thanks for your efforts and your help!
But what exactly means "having two parents" for a body surface?
I understand that the bodies exist and that then the physical properties can be entered, but, if the selected body for which you want to enter the physical properties is not red highlighted, how do you know which body it is in the graphical window?
And really I insist on the fact that a few weeks ago, when I made my first 3D multibodies model (the EM cold crucible), I am sure that I had no such problems with the bodies selecting. Maybe that was with a former Elmer version which had no problem....?
So my question is: how do you identify the right body (for entering the physical properties for instance) when you cannot select them graphically? Meaning, in the cube example, which is cube1, cube2, cube3, etc...?
We keep in touch.
Roland
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Impossible to select bodies

Post by kevinarden »

'But what exactly means "having two parents" for a body surface?'

Between the internal body and the external body there are surface elements that become a boundary surface, however since the boundary surface elements, and both bodies share the same nodes at this interface the boundary is defined as belonging to both bodies (the boundary surface has two parents),

'how do you know which body it is in the graphical window?"

If you use gmsh and only ElmerGUI to open the msh file, then the first body created in gmsh is body 1, the second body created in gmsh is body 2, and so forth.

If however you use physical groups, and use ElmerGrid to convert the msh file to a Elmer mesh, then a file is created called mesh.names that tells you which physical group became which body.

'my first 3D multibodies model (the EM cold crucible), I am sure that I had no such problems with the bodies selecting.'

I believe it is because it had a plane of symmetry and the surfaces on the plane will highlight when the body is selected. The symmetry plane surfaces have only 1 parent (i.e. they are associated with only 1 body)
Roland
Posts: 226
Joined: 12 Apr 2018, 11:29
Antispam: Yes

Re: Impossible to select bodies

Post by Roland »

Hi,
Thank you Kevin for your very clear explanations, and especially about the identification of the different bodies by their numbering.
But I am still sure that I didn't have this selecting problem a few weeks ago...
And say that when the 3D geometry is quite simple, like the 3 cubes 1,2,3 surrounded by a cube 4, as you say, the Body Property 1,2,3,4 corresponds to the cubes 1,2,3,4. This is ok.
But when the geometry comes from several objects for which for instance boolean operations (like intersection, difference, union, etc...) give different bodies, how is it possible then to identify theses bodies and their numbering in the GUI?
For instance, I tried to make with Gmsh a 3D extension of the former 2D "EM_levitation " model. As you know perhaps, there is a liquid charge which should levitate thanks to the electromagnetic Lorentz forces created by a surrounding conical lower inductor and which is also restrained by an upper conical coil(it is a "counter coil"). These coils have been made by rotating extrusion from the cross section 2D geometry. I attach the 3D_half.geo and 3D_half.msh files to this post. So in this more complex geometry how is it possible to identify the lower inductor, the upper inductor, the liquid charge, and the surrounding outer cylinder in Elmer GUI?
Thanks in advance for your help.
Roland
Attachments
3D_half.zip
Gmsh compressed 3D_half.msh file
(647.3 KiB) Downloaded 99 times
3D_half.geo
Gmsh geometry 3D_half.geo file
(1.5 KiB) Downloaded 98 times
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Impossible to select bodies

Post by kevinarden »

Yes it becomes more complicated with more complex geometry. In the attached picture I loaded the gmsh file beside the ElmerGUI file and turned on the volume labels in gmsh. There you can see that Volume 1 is the middle sphere and becomes body 1, Volume 2 is the lower cone and becomes body 2, Volume 3 is the upper cone, and becomes body 3, and Volume 4 is the outer cylinder and becomes body 4.

To verify I edited the mesh.boundary file to make the second parent 0, thereby making the boundary surfaces related only to 1 body. If you save the project and then replace the mesh.boundary file with this mesh.boundary file, reload the mesh, then the bodies will highlight. Of course you have to hide body 4 to see the internal bodies.
bodies.png
(199.14 KiB) Not downloaded yet
mesh.boundary
(231.54 KiB) Downloaded 105 times
Roland
Posts: 226
Joined: 12 Apr 2018, 11:29
Antispam: Yes

Re: Impossible to select bodies

Post by Roland »

Hi,
Thanks again Kevin.
I will try this and say that it is a good trick, even if it complexifies a little the model description...
On the other hand do you think that Peter could do some small change in the Elmer version in order to fix definitly this problem?
We keep us informed.
Roland
Post Reply