SPECFEM / specfem2d

SPECFEM2D simulates forward and adjoint seismic wave propagation in two-dimensional acoustic, (an)elastic, poroelastic or coupled acoustic-(an)elastic-poroelastic media, with Convolution PML absorbing conditions.
GNU General Public License v3.0
204 stars 147 forks source link

LibGmsh2Specfem_convert_Gmsh_to_Specfem2D_official.py , it can not work well in par with Gmsh_4.1.5 #1034

Open brioglade opened 5 years ago

brioglade commented 5 years ago

~/specfem2d/EXAMPLES/Gmsh_example_Stacey_MPI/MESH,in this file,if I mesh SqrCirc.geo in Gmsh_4.1.5,it turn out that -

Traceback (most recent call last): File "./LibGmsh2Specfem_convert_Gmsh_to_Specfem2D_official.py", line 445, in OuvreGmsh('',Fic, Bords) File "./LibGmsh2Specfem_convert_Gmsh_to_Specfem2D_official.py", line 200, in OuvreGmsh (string.split(lignes[Pos])[5:])] ValueError: cannot copy sequence with size 0 to array axis with dimension 2

Comparing with the mesh from Gmsh_2.0.8 (hitting format in the SqrCirc.msh),they are different too. Is LibGmsh2Specfem_convert_Gmsh_to_Specfem2D_official.py outdated ?

danielpeter commented 5 years ago

thanks for pointing out!

yes, the script LibGmsh2Specfem_convert_Gmsh_to_Specfem2D_official.py requires the (legacy) MSH format 2. please consider saving your mesh with the added option -format msh22 for now.

for example, run: gmsh SqrCirc.geo -2 -order 2 -format msh22 -o SqrCirc.msh

this will work with Gmsh version 4.x and will produce the right mesh format for the specfem script to work.