gimli-org / example-data

Collection of example data for the use in tutorials & examples
4 stars 5 forks source link

I am getting the following error while creating a 3D mesh what is the reason? #4

Open zhichaoluan opened 1 year ago

zhichaoluan commented 1 year ago
import pygimli as pg
import pygimli.meshtools as mt
from pygimli.physics import ert
from pygimli.viewer import pv

data = pg.getExampleData("ert/gallery3d.dat")
data["k"] = ert.geometricFactors(data, dim=3)
print(data)

plc = mt.createParaMeshPLC3D(data, paraDepth=12, paraMaxCellSize=1,
                             surfaceMeshQuality=34)
print(plc)
mesh = mt.createMesh(plc, quality=1.3)
print(mesh)

I am getting the following error while creating a 3D mesh what is the reason?

C:\Users\asus\.conda\envs\pg\python.exe E:/pyGIMLi/beijing96/3d1.py
03/08/23 - 16:05:42 - pyGIMLi - Data: Sensors: 126 data: 753, nonzero entries: ['a', 'b', 'k', 'm', 'n', 'rhoa', 'valid']
INFO - Looking for ert/gallery3d.dat in gimli-org/example-data/
Mesh: Nodes: 596 Cells: 0 Boundaries: 1157
'tetgen' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���
Traceback (most recent call last):
  File "E:\pyGIMLi\beijing96\3d1.py", line 13, in <module>
    mesh = mt.createMesh(plc, quality=1.3)
  File "C:\Users\asus\.conda\envs\pg\lib\site-packages\pygimli\meshtools\mesh.py", line 148, in createMesh
    mesh = pg.meshtools.syscallTetgen(namePLC, quality, area,
  File "C:\Users\asus\.conda\envs\pg\lib\site-packages\pygimli\meshtools\polytools.py", line 1893, in syscallTetgen
    mesh = pg.meshtools.readTetgen(filebody + '-1')
  File "C:\Users\asus\.conda\envs\pg\lib\site-packages\pygimli\meshtools\mesh.py", line 963, in readTetgen
    with open(fName + '.node', 'r') as node_in:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\asus\\AppData\\Local\\Temp\\tmp3sc6apj4-1.node'
halbmy commented 1 year ago

Seems like tetgen is not working properly, please check whether it is installed.

Please provide (as mentioned in the issue template) information on how you installed pyGIMLi and the version number.

halbmy commented 1 year ago

Without knowing your version, I guess you could be using pyGIMLi v1.4.0 where we missed to specify tetgen as dependency for the conda package (see also https://github.com/gimli-org/gimli/discussions/526). In this case, install tetgen (conda install tetgen) and try again.