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.
https://specfem.org
GNU General Public License v3.0
203 stars 147 forks source link

cubit2specfem2d.py "mesh" is not defined! #1168

Closed AbolfazlKhanMo closed 1 year ago

AbolfazlKhanMo commented 2 years ago

Hi all,

I was using specfem2d on my previous OS (Ubuntu 20.04). After upgrading to Ubuntu 22.4, when I run the "cubit2specfem2d.py" script to get the necessary files in specfem2d format, I get the following error:

(Non-Commercial License) Cubit> Traceback (most recent call last): File "", line 750, in File "", line 3, in export2SPECFEM2D NameError: name 'mesh' is not defined

Rolled back to the previous os version, and I am still getting the same error. Thank you!

AbolfazlKhanMo commented 1 year ago

I'm going to close this because I solved it. But I only ran a homogeneous media and the "paper_axisymmetry_example" simulations using Cubit! They both work fine.

Solution steps: (1) you don't need the "sets" module for calling the "set" function in python anymore. Comment all the from sets import Set lines. (2) Also, in line 257 of the script, switch the"mesh_tools" and "object". So, it should be _class mesh(meshtools,object):