Here is a simplified example of my problem.
I used gmsh for mesh generation :
$ gmsh cube.geo -3 -order 2 -format unv
Please find attached the cube.geo.
Then I ran ElmerGrid :
$ ElmerGrid 8 2 cube.unv -autoclean
Then I ran ElmerSolver :
$ ElmerSolver cube.sif (see attached)
In cube.sif, if I write Target Boundaries = 2 instead of Target Boundaries (2) = 1 2 (line 42)
and Target Boundaries = 2 instead of Target Boundaries = 3 (line 48)
then I get a bad assignment of potentials on surfaces.
In this example the Physical Surface("Cathode") is made of two surfaces 1 and 2 (see cube.geo) so this is not a problem to change le line 42 as above.
But in case the Physical Surface("Cathode") is made of a large number of surfaces, I will not be able to list all the surfaces like I did line 42 in cube.sif.
Is there a way to simplify this problem?
How to assign boundary conditions to a large amount of surfaces
-
- Posts: 5
- Joined: 28 Mar 2019, 12:56
- Antispam: Yes
-
- Posts: 2237
- Joined: 25 Jan 2019, 01:28
- Antispam: Yes
Re: How to assign boundary conditions to a large amount of surfaces
seems to be a problem with the translation of gmsh to elmer. in gmsh I get this mesh
opening in ElmerGui either by unv directly or after ElmerGrid I get this
opening in ElmerGui either by unv directly or after ElmerGrid I get this
-
- Posts: 2237
- Joined: 25 Jan 2019, 01:28
- Antispam: Yes
Re: How to assign boundary conditions to a large amount of surfaces
I used salome to create a tet mesh on cube and exported a unv file, read fine into elmer.
I used gmsh to create a tet mesh on cube and exported a unv file, would not read the solid elements into elmer.
Reading the text files of both elmer meshes, I am not seeing the difference yet.
I used gmsh to create a tet mesh on cube and exported a unv file, would not read the solid elements into elmer.
Reading the text files of both elmer meshes, I am not seeing the difference yet.
Re: How to assign boundary conditions to a large amount of surfaces
Hi,
To see volume mesh just click View-> Volume mesh in Elmer.
To see volume mesh just click View-> Volume mesh in Elmer.
-
- Posts: 2237
- Joined: 25 Jan 2019, 01:28
- Antispam: Yes
Re: How to assign boundary conditions to a large amount of surfaces
Ok, so there are not surfaces on every side?
-
- Posts: 2237
- Joined: 25 Jan 2019, 01:28
- Antispam: Yes
Re: How to assign boundary conditions to a large amount of surfaces
When i load into ElmerGUI cathode is surface 1 and 2, but anode is surface 3
Re: How to assign boundary conditions to a large amount of surfaces
Using Physical Surfaces approach only the defined surfaces are shown in GUI. And so available to set BC. I see it very comfortable for complex geometries.Ok, so there are not surfaces on every side?
Strange, according to my experience 1 and 2 should be together denoted as 1 and 3 as 2, but I use msh instead of unv and my gmsh is not up to date.When I load into ElmerGUI cathode is surface 1 and 2, but anode is surface 3
-
- Posts: 2237
- Joined: 25 Jan 2019, 01:28
- Antispam: Yes
Re: How to assign boundary conditions to a large amount of surfaces
Your mesh and sif ran fine
-
- Posts: 5
- Joined: 28 Mar 2019, 12:56
- Antispam: Yes
Re: How to assign boundary conditions to a large amount of surfaces
Hi,
thanks all for your replies.
Maybe, I was not clear in my request. So I give you some images to illustrate it.
Here is the cube_01.sif file with the two options see CUBE_01 and CUBE_02 paragraphs.
The result of CUBE_01 is shown as cube_01.jpg and the CUBE_02 as cube_02.jpg.
In cube_01.jpg, the second surface "anode" becomes the second surface which composes the "cathode" and the "cathode" becomes the first one. In cube_02.jpg, the "anode" and "cathode" are well assigned.
thanks all for your replies.
Maybe, I was not clear in my request. So I give you some images to illustrate it.
Here is the cube_01.sif file with the two options see CUBE_01 and CUBE_02 paragraphs.
The result of CUBE_01 is shown as cube_01.jpg and the CUBE_02 as cube_02.jpg.
In cube_01.jpg, the second surface "anode" becomes the second surface which composes the "cathode" and the "cathode" becomes the first one. In cube_02.jpg, the "anode" and "cathode" are well assigned.
- Attachments
-
- cube_01.sif
- (2.03 KiB) Downloaded 241 times
Re: How to assign boundary conditions to a large amount of surfaces
Hi,
as was suggested before, you will get what (I think) you want if you do file->export in gmsh, use .msh as file extension, set the format to "version 2 ASCII" and do NOT check "save all elements". gmsh then saves a mesh file cube.msh with only the physical bodies and boundaries. You can open that file in ElmerGUI. If you don't use ElmerGUI, it's ElmerGrid 14 2 cube.msh on the command line. The mesh will have the boundaries numbered as in the physical surfaces you have defined in gmsh. I have just tested it, your cube has then only two boundaries numbered 1 and 2.
HTH,
Matthias
as was suggested before, you will get what (I think) you want if you do file->export in gmsh, use .msh as file extension, set the format to "version 2 ASCII" and do NOT check "save all elements". gmsh then saves a mesh file cube.msh with only the physical bodies and boundaries. You can open that file in ElmerGUI. If you don't use ElmerGUI, it's ElmerGrid 14 2 cube.msh on the command line. The mesh will have the boundaries numbered as in the physical surfaces you have defined in gmsh. I have just tested it, your cube has then only two boundaries numbered 1 and 2.
HTH,
Matthias