Pycharm AssertionError:Gmsh退出并返回错误(返回码3221225781)

时间:2020-07-16 10:56:20

标签: python pycharm

我一直试图在pygmsh网站(https://pypi.org/project/pygmsh/)上运行第二个示例,但是我一直遇到错误。首先找不到文件,然后出现错误“找不到文件,找不到指定的文件”,但是现在我已经解决了该部分,我得到了这个新错误(AssertionError:Gmsh退出并显示错误(返回代码3221225781)。据某些人说,我缺少DLL文件(github DLL problem/answer),但实际上我只是重新安装了gmsh,没有错误。我可以看到gmsh已添加到venv中的解释器路径中,甚至直接将路径添加到gmsh.exe,但我仍然收到此错误消息。

我正在Windows 10上使用Pycharm(最新版本)。


geom = pygmsh.opencascade.Geometry(
  characteristic_length_min=0.1,
  characteristic_length_max=0.1,
  )

rectangle = geom.add_rectangle([-1.0, -1.0, 0.0], 2.0, 2.0)
disk1 = geom.add_disk([-1.2, 0.0, 0.0], 0.5)
disk2 = geom.add_disk([+1.2, 0.0, 0.0], 0.5)
union = geom.boolean_union([rectangle, disk1, disk2])

disk3 = geom.add_disk([0.0, -0.9, 0.0], 0.5)
disk4 = geom.add_disk([0.0, +0.9, 0.0], 0.5)
flat = geom.boolean_difference([union], [disk3, disk4])

geom.extrude(flat, [0, 0, 0.3])

#mesh = pygmsh.generate_mesh(geom)
#mesh = pygmsh.generate_mesh(geom, gmsh_path = 'D:\Data\Documenten\TUD\ME\AFEM\venv\Lib\site-packages\gmsh-4.6.0-Windows64-sdk/bin\gmsh.exe')
mesh = pygmsh.generate_mesh(geom, gmsh_path = 'D:/Data/Documenten/TUD/ME/AFEM/venv/Lib/site-packages/gmsh-4.6.0-Windows64-sdk/bin/gmsh.exe')
#mesh = pygmsh.generate_mesh(geom, gmsh_path = 'D:/Data/Documenten/TUD/ME/AFEM/venv/Lib/site-packages/gmsh-4.6.0-Windows64-sdk/lib/gmsh.py')
#mesh = pygmsh.generate_mesh(geom, gmsh_path = 'D/Data/Documenten/TUD/ME/AFEM/gmsh-4.6.0-Windows64/gmsh.exe')

pycharm输出:

D:\Data\Documenten\TUD\ME\AFEM\venv\Scripts\python.exe D:/Data/Documenten/TUD/ME/AFEM/stdFEM/geometrytest.py
Traceback (most recent call last):
File "D:/Data/Documenten/TUD/ME/AFEM/stdFEM/geometrytest.py", line 21, in
mesh = pygmsh.generate_mesh(geom, gmsh_path = 'D:/Data/Documenten/TUD/ME/AFEM/venv/Lib/site-packages/gmsh-4.6.0-Windows64-sdk/bin/gmsh.exe')
File "D:\Data\Documenten\TUD\ME\AFEM\venv\lib\site-packages\pygmsh\helpers.py", line 133, in generate_mesh
assert p.returncode == 0, "Gmsh exited with error (return code {}).".format(
AssertionError: Gmsh exited with error (return code 3221225781).

    

Process finished with exit code 1

请忽略第一,第二,第三和第四#mesh部件,我只想用这些线进行测试。

0 个答案:

没有答案