## How Geometry Mappings in ElemerGrid works?

General discussion about Elmer
Posts: 12
Joined: 20 Sep 2016, 23:56
Antispam: Yes

### How Geometry Mappings in ElemerGrid works?

I am trying to learn ElmerGrid .grd file syntax for parametric simulations in Elmer multiphysics. So far I have realised that the nD space (1 < n <3 ) is divided into subcells (squares) and then materials are assigned to them. But I can't understand how Geometry Mappings work. for example the code below generates a square with a highth of 1 and width of 5:

Code: Select all

``````***** ElmerGrid input file for structured grid generation *****
Version = 210903
Coordinate System = Cartesian 2D
Subcell Divisions in 2D = 1 1
Subcell Limits 1 = 0 5
Subcell Limits 2 = 0 1
Material Structure in 2D
1
End
Materials Interval = 1 1``````
shape 1 below:

and the geometry mapping below maps it to 2:

Code: Select all

``````Geometry Mappings
! mode line limits(2) Np params(Np)
1    0    1.0   1.0 8  0.0 0.1 1.0 -0.1 3.0 0.1 5.0 -0.1
5    1    1.0   1.0 4  0.0 5.0 3.0 -0.3
End``````
I have read section "2.3 Mapping modes" of ElmerGrid manual several times but I can't get my head around it. I can't understand the anatomy of the syntax. what those columns "mode", "line", "limits(2)", "Np" "params(Np)" and numbers blow them mean? maybe there are more documentations with details explaining the the syntax?

mzenker
Posts: 1766
Joined: 07 Dec 2009, 11:49
Location: Germany

### Re: How Geometry Mappings in ElemerGrid works?

Hi,

I would advise to use an external mesher like gmsh or Salomé. Both have geometry modules that can be scripted, and both are far more powerful than ElmerGrid. I would use ElmerGrid only for conversion of meshes generated by external meshers to Elmer format.

HTH,

Matthias

Posts: 12
Joined: 20 Sep 2016, 23:56
Antispam: Yes

### Re: How Geometry Mappings in ElemerGrid works?

Hi Matthias,

Thanks a lot for your reply. could you please point me towards a manual for scripting in Gmsh and/or Salome?
Besides I could not help but find out how the syntax really works. Apart from the crazy brain all the Elmer tutorials are also written in this format and I want to use them. Would you be so kind to help me understand how this command works?

mzenker
Posts: 1766
Joined: 07 Dec 2009, 11:49
Location: Germany

### Re: How Geometry Mappings in ElemerGrid works?

Hi,

the scripting language of gmsh (in the .geo files) is explained in their documentation, see http://gmsh.info. For Salomé (http://www.salome-platform.org), you can do the scripting in Python, see http://docs.salome-platform.org/latest/ ... _page.html. The best starting point is to build a simple geometry with the GUI (geometry module) and then dump a python script which you modify according to your needs.
I cannot help you with the ElmerGrid .grd commands since I never use them, but there are .grd files for all tutorials here.

HTH,

Matthias

raback