我正在尝试针对水平集一维问题运行下面的代码(例如在 fipy 网页中)。我收到此错误:
回溯(最后一次调用):文件“C:/Users/sgowda/Documents/pde solver code/level set 1D.py”,第 20 行,在 var.calcDistanceFunction() 文件“C:\Users\sgowda\AppData\ Local\Continuum\Anaconda\lib\site-packages\fipy\variables\distanceVariable.py”,第 335 行,在 calcDistanceFunction 中引发异常,“在 $PATH 上lsmlib
也skfmm
找不到”异常:在 $PATH 上lsmlib
也找不到也skfmm
找不到小路
你能否让我知道如何解决这个问题。我尝试查看 distancefucntion() 但我不确定这个错误是什么意思?
from fipy import Grid1D, CellVariable, TransientTerm, DiffusionTerm, Viewer, DistanceVariable
import matplotlib.pyplot as plt
velocity = 1.
dx = 1.
nx = 10
timeStepDuration = 1.
steps = 2
L = nx * dx
interfacePosition = L / 5.
from fipy.tools import serialComm
mesh = Grid1D(dx=dx, nx=nx, communicator=serialComm)
var = DistanceVariable(name='level set variable',
mesh=mesh,
value=-1.,
hasOld=1)
var.setValue(1., where=mesh.cellCenters[0] > interfacePosition)
var.calcDistanceFunction()
advEqn = TransientTerm() + FirstOrderAdvectionTerm(velocity)
viewer = Viewer(vars=var, datamin=-10., datamax=10.)
viewer.plot()
for step in range(steps):
var.updateOld()
advEqn.solve(var, dt=timeStepDuration)
viewer.plot()
plt.show()