ttim
ttim copied to clipboard
Circular Inhomogeneity results in IndexError
(Zoals ik donderdag al even meldde:) Adding a circular inhomogeneity leads to an IndexError. The following (simplified) case runs fine:
import ttim
ml = ttim.ModelMaq(kaq=[30],z=[0,-10,-50],Saq=[0.001],
c=[1500], Sll=[0.01],
topboundary='leaky', phreatictop=True,tmin=1,tmax=30,M=20)
ttim.Well(ml,xw=0,yw=0,rw=0.5,tsandQ=[(4.0,2500),(25,0.),(30,0.)],
res=0.0,layers=0,rc=None,wbstype='pumping',label=None)
ml.solve()
But adding:
ttim.CircInhomMaq(ml,x0=0,y0=0,R=5,order=1,
kaq=[30],z=[0,-10,-50],Saq=[0.001],
c=[1500], Sll=[0.01],
topboundary='leaky', phreatictop=True)
ml.solve()
Results in the following error:
Traceback (most recent call last):
File "<ipython-input-7-35237950a7fc>", line 14, in <module>
ml.solve()
File "D:\Anaconda\envs\py27\lib\site-packages\ttim\ttim.py", line 277, in solve
mat[ ieq:ieq+e.Nunknowns, :, : ], rhs[ ieq:ieq+e.Nunknowns, :, : ] = e.equation()
File "D:\Anaconda\envs\py27\lib\site-packages\ttim\ttim.py", line 1088, in equation
e.potinflayers(self.xc[icp],self.yc[icp],self.pylayers,self.aqin) / self.aqin.T[self.pylayers][:,np.newaxis,np.newaxis] - \
File "D:\Anaconda\envs\py27\lib\site-packages\ttim\ttim.py", line 670, in potinflayers
return rv[pylayers,:]
IndexError: index 1 is out of bounds for axis 0 with size 1
Using more layers results in the same error message ("Index N is out of bounds for axis 0 with size N").
As an aside, with regards to zero indexing in general, it looks like ModelMaq() does not accept tmin=0. (Of course, this is not a serious hindrance.)
Met vriendelijke groeten, Huite
See the following commit 44145c0. You can checkout the master branch or do a manual fix on your machine.
I'm guessing this one is fixed, given the referenced commit in the previous post. Reopen if that's not the case.