3

我正在尝试将模型网格从 Modflow 模型写入 vtk 输出以在 Paraview 中打开。

我使用了地下水远景并创建了 MODFLOW - USG(非结构化网格)

当我尝试使用导出功能时,出现以下错误:

回溯(最近一次通话最后):

File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.2.5\helpers\pydev\pydevd.py", line 1415, in _exec pydev_imports.execfile(file, globals, locals) # 执行脚本

文件“C:\Program Files\JetBrains\PyCharm Community Edition 2019.2.5\helpers\pydev_pydev_imps_pydev_execfile.py”,第 18 行,在 execfile exec(compile(contents+"\n", file, 'exec'), glob, loc)

文件“C:/Work/Models/Work/Projects/Job 302/Export grid.py”,第 16 行,在 vtkobj = fp.export.vtk.Vtk(mf)

文件“C:\ProgramData\Anaconda3\lib\site-packages\flopy\export\vtk.py”,第 206 行,在init self.shape = (self.modelgrid.nlay, self.modelgrid.nrow,

AttributeError:“网格”对象没有属性“nlay”

下面是我使用的代码:

import os
import flopy as fp
from flopy.export import vtk as fv

model_path = r'C:\Work\Models\302'
os.chdir(model_path)

# MODFLOW name file:
namefile = 'westend_Alluv3_11yr_A.nam'

mf = fp.modflow.Modflow.load(namefile,verbose=False,check=False)

# create the vtk object
vtkobj = fp.export.vtk.Vtk(mf)

谢谢

4

0 回答 0