'NameError: name 'device' is not defined'

Hi, I’m asking for help because I’m in trouble.
When opening the gmsh_diode2d.py in python spyder, the error ‘NameError: name ‘device’ is not defined’ appears continuously. How do I prevent errors?
KakaoTalk_20230223_155400085

And if I output gmsh_diode2d.py normally, will it output the same as the result mesh of gmsh_diode2d.msh?

Hi @psj0118

Usually there is 1 device, and you can get the device name using:

device=devsim.get_device_list()[0]

and if there is only 1 region:

region=devsim.get_region_list(device=device)[0]

the solution will be on the same mesh coordinates, but you would need to match them. I usually use VisIt or Paraview to look at the tecplot results from the devsim.write_devices command