---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
<ipython-input-4-986a9bfede1b> in <module>
19 loop_count = 0
20 while True:
---> 21 swres_new = eq.sweep(dt = dt)
22 sw.value[sw.value>1-sor]=1-sor
23 sw.value[sw.value<swc]=swc
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/terms/term.py in sweep(self, var, solver, boundaryConditions, dt, underRelaxation, residualFn, cacheResidual, cacheError)
212 `Term`
213 """
--> 214 solver = self._prepareLinearSystem(var=var, solver=solver, boundaryConditions=boundaryConditions, dt=dt)
215 solver._applyUnderRelaxation(underRelaxation=underRelaxation)
216 residual = solver._calcResidual(residualFn=residualFn)
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/terms/term.py in _prepareLinearSystem(self, var, solver, boundaryConditions, dt)
128 transientGeomCoeff=self._getTransientGeomCoeff(var),
129 diffusionGeomCoeff=self._getDiffusionGeomCoeff(var),
--> 130 buildExplicitIfOther=self._buildExplcitIfOther)
131
132 self._buildCache(matrix, RHSvector)
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/terms/coupledBinaryTerm.py in _buildAndAddMatrices(self, var, SparseMatrix, boundaryConditions, dt, transientGeomCoeff, diffusionGeomCoeff, buildExplicitIfOther)
86 transientGeomCoeff=uncoupledTerm._getTransientGeomCoeff(tmpVar),
87 diffusionGeomCoeff=uncoupledTerm._getDiffusionGeomCoeff(tmpVar),
---> 88 buildExplicitIfOther=buildExplicitIfOther)
89
90 termMatrix += tmpMatrix
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/terms/binaryTerm.py in _buildAndAddMatrices(self, var, SparseMatrix, boundaryConditions, dt, transientGeomCoeff, diffusionGeomCoeff, buildExplicitIfOther)
32 transientGeomCoeff=transientGeomCoeff,
33 diffusionGeomCoeff=diffusionGeomCoeff,
---> 34 buildExplicitIfOther=buildExplicitIfOther)
35
36 matrix += tmpMatrix
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/terms/binaryTerm.py in _buildAndAddMatrices(self, var, SparseMatrix, boundaryConditions, dt, transientGeomCoeff, diffusionGeomCoeff, buildExplicitIfOther)
32 transientGeomCoeff=transientGeomCoeff,
33 diffusionGeomCoeff=diffusionGeomCoeff,
---> 34 buildExplicitIfOther=buildExplicitIfOther)
35
36 matrix += tmpMatrix
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/terms/unaryTerm.py in _buildAndAddMatrices(self, var, SparseMatrix, boundaryConditions, dt, transientGeomCoeff, diffusionGeomCoeff, buildExplicitIfOther)
65 dt=dt,
66 transientGeomCoeff=transientGeomCoeff,
---> 67 diffusionGeomCoeff=diffusionGeomCoeff)
68 elif buildExplicitIfOther:
69 _, matrix, RHSvector = self._buildMatrix(self.var,
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/terms/abstractDiffusionTerm.py in _buildMatrix(self, var, SparseMatrix, boundaryConditions, dt, transientGeomCoeff, diffusionGeomCoeff)
321 ids = self._reshapeIDs(var, numerix.arange(mesh.numberOfCells))
322 L.addAt(self.constraintL.ravel(), ids.ravel(), ids.swapaxes(0, 1).ravel())
--> 323 b += numerix.reshape(self.constraintB.ravel(), ids.shape).sum(-2).ravel()
324
325 return (var, L, b)
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/variables/variable.py in ravel(self)
1394
1395 def ravel(self):
-> 1396 return self.value.ravel()
1397
1398 def _axisClass(self, axis):
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/variables/variable.py in _getValue(self)
491
492 if self.stale or not self._isCached() or self._value is None:
--> 493 value = self._calcValue()
494 if self._isCached():
495 self._setValueInternal(value=value)
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/variables/operatorVariable.py in _calcValue(self)
53 return self._execInline(comment=self.comment)
54 else:
---> 55 return self._calcValue_()
56
57 def _calcValue_(self):
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/variables/binaryOperatorVariable.py in _calcValue_(self)
46 val1 = self.var[1]
47
---> 48 return self.op(self.var[0].value, val1)
49
50 @property
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/variables/variable.py in _getValue(self)
491
492 if self.stale or not self._isCached() or self._value is None:
--> 493 value = self._calcValue()
494 if self._isCached():
495 self._setValueInternal(value=value)
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/variables/operatorVariable.py in _calcValue(self)
53 return self._execInline(comment=self.comment)
54 else:
---> 55 return self._calcValue_()
56
57 def _calcValue_(self):
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/variables/binaryOperatorVariable.py in _calcValue_(self)
46 val1 = self.var[1]
47
---> 48 return self.op(self.var[0].value, val1)
49
50 @property
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/variables/variable.py in _getValue(self)
491
492 if self.stale or not self._isCached() or self._value is None:
--> 493 value = self._calcValue()
494 if self._isCached():
495 self._setValueInternal(value=value)
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/variables/operatorVariable.py in _calcValue(self)
53 return self._execInline(comment=self.comment)
54 else:
---> 55 return self._calcValue_()
56
57 def _calcValue_(self):
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/variables/unaryOperatorVariable.py in _calcValue_(self)
34 class unOp(operatorClass):
35 def _calcValue_(self):
---> 36 return self.op(self.var[0].value)
37
38 @property
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/variables/variable.py in _getValue(self)
491
492 if self.stale or not self._isCached() or self._value is None:
--> 493 value = self._calcValue()
494 if self._isCached():
495 self._setValueInternal(value=value)
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/variables/addOverFacesVariable.py in _calcValue(self)
29 return self._calcValueInline()
30 else:
---> 31 return self._calcValueNoInline()
32
33 def _calcValueInline(self):
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/variables/addOverFacesVariable.py in _calcValueNoInline(self)
70 ids = self.mesh.cellFaceIDs
71
---> 72 contributions = numerix.take(self.faceVariable, ids, axis=-1)
73
74 # FIXME: numerix.MA.filled casts away dimensions
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/tools/numerix.py in take(a, indices, axis, fill_value)
600
601 if _isPhysical(a):
--> 602 taken = a.take(indices, axis=axis)
603 elif isinstance(indices, type(MA.array((0)))):
604 ## Replaces `MA.take`. `MA.take` does not always work when
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/variables/variable.py in take(self, ids, axis)
1463
1464 def take(self, ids, axis=0):
-> 1465 return numerix.take(self.value, ids, axis)
1466
1467 def allclose(self, other, rtol=1.e-5, atol=1.e-8):
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/variables/variable.py in _getValue(self)
495 self._setValueInternal(value=value)
496 else:
--> 497 self._setValueInternal(value=None)
498 self._markFresh()
499 else:
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/variables/variable.py in _setValueInternal(self, value, unit, array)
622
623 def _setValueInternal(self, value, unit=None, array=None):
--> 624 self._value = self._makeValue(value=value, unit=unit, array=array)
625
626 def _makeValue(self, value, unit=None, array=None):
~/miniconda3/envs/myfipy/lib/python3.7/site-packages/fipy/variables/variable.py in _makeValue(self, value, unit, array)
659 array[:] = value
660 value = array
--> 661 elif type(value) not in (type(None), type(numerix.array(1)), type(numerix.MA.array(1))):
662 value = numerix.array(value)
663 ## # numerix does strange things with really large integers.
KeyboardInterrupt: