我試圖運行下面的代碼來設置1D級別的問題(例如在fipy網頁中)。我收到此錯誤: var.calcDistanceFunction 20行(fipy-level set 1D
回溯(最近通話最後一個): 文件 「/用戶/ sgowda /文檔/ PDE求解器代碼/級別設置1D.py C」 ) 文件「C:\ Users \ sgowda \ AppData \ Local \ Continuum \ Anaconda \ lib \ site-packages \ fipy \ variables \ distanceVariable.py」,第335行,在calcDistanceFunction 引發異常,「既不lsmlib
也不skfmm
可以在$ PATH」 異常發現:無論是lsmlib
也不skfmm
可以在$ PATH
可否請你讓我知道如何解決這一發現。我試圖調查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()