You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I discussed this issue with Louis and reporting it as he requested.
While using the Darcy solve if this line: darcy_solver.constitutive_model.Parameters.s = sympy.Matrix([0, 0]).T, is not there, I am getting this error message.
---------------------------------------------------------------------------TypeErrorTraceback (mostrecentcalllast)
CellIn[15], line1---->1darcy_solver.solve()
File [~/Documents/codes/uw3-local-installation/uw3_folder/src/underworld3/systems/solvers.py:337](http://localhost:8888/lab/tree/~/Documents/codes/uw3-local-installation/uw3_folder/src/underworld3/systems/solvers.py#line=336), in SNES_Darcy.solve(self, zero_init_guess, timestep, verbose, _force_setup)324""" 325 Generates solution to constructed system. 326 (...) 333 value used to evaluate inertial contribution 334 """336if (notself.is_setup) or_force_setup:
-->337self._setup_pointwise_functions(verbose)
338self._setup_discretisation(verbose)
339self._setup_solver(verbose)
Filesrc[/underworld3/cython/petsc_generic_snes_solvers.pyx:717](http://localhost:8888/underworld3/cython/petsc_generic_snes_solvers.pyx#line=716), in underworld3.cython.generic_solvers.SNES_Scalar._setup_pointwise_functions()File [~/Documents/codes/uw3-local-installation/uw3_folder/src/underworld3/systems/solvers.py:277](http://localhost:8888/lab/tree/~/Documents/codes/uw3-local-installation/uw3_folder/src/underworld3/systems/solvers.py#line=276), in SNES_Darcy.darcy_problem_description(self)274self._f0=self.F0.value276# f1 residual term (integration by parts [/](http://localhost:8888/) gradients)-->277self._f1=self.F1.value279# Flow calculation280self._v_projector.uw_function=-self.F1.valueFile [~/Documents/codes/uw3-local-installation/uw3_folder/src/underworld3/systems/solvers.py:261](http://localhost:8888/lab/tree/~/Documents/codes/uw3-local-installation/uw3_folder/src/underworld3/systems/solvers.py#line=260), in SNES_Darcy.F1(self)256 @property257defF1(self):
259F1_val=uw.function.expression(
260r"\mathbf{F}_1\left( \mathbf{u} \right)",
-->261sympy.simplify(self.darcy_flux),
262"Darcy pointwise flux term: F_1(u)",
263 )
265# backward compatibility266self._f1=F1_val.valueFile [~/Documents/codes/uw3-local-installation/uw3_folder/src/underworld3/systems/solvers.py:304](http://localhost:8888/lab/tree/~/Documents/codes/uw3-local-installation/uw3_folder/src/underworld3/systems/solvers.py#line=303), in SNES_Darcy.darcy_flux(self)302 @property303defdarcy_flux(self):
-->304flux=self.constitutive_model.flux.T305returnfluxFile [~/Documents/codes/uw3-local-installation/uw3_folder/src/underworld3/constitutive_models.py:1584](http://localhost:8888/lab/tree/~/Documents/codes/uw3-local-installation/uw3_folder/src/underworld3/constitutive_models.py#line=1583), in DarcyFlowModel.flux(self)1577 @property1578defflux(self):
1579"""Computes the effect of the constitutive tensor on the gradients of the unknowns. 1580 (always uses the `c` form of the tensor). In general cases, the history of the gradients 1581 may be required to evaluate the flux. 1582 """->1584ddu=self.grad_u-self.Parameters.s1586returnself._q(ddu)
File [~/Documents/codes/uw3-local-installation/uw3-env/lib/python3.11/site-packages/sympy-1.12-py3.11.egg/sympy/core/decorators.py:106](http://localhost:8888/lab/tree/~/Documents/codes/uw3-local-installation/uw3-env/lib/python3.11/site-packages/sympy-1.12-py3.11.egg/sympy/core/decorators.py#line=105), in call_highest_priority.<locals>.priority_decorator.<locals>.binary_op_wrapper(self, other)104iffisnotNone:
105returnf(self)
-->106returnfunc(self, other)
File [~/Documents/codes/uw3-local-installation/uw3-env/lib/python3.11/site-packages/sympy-1.12-py3.11.egg/sympy/matrices/common.py:2937](http://localhost:8888/lab/tree/~/Documents/codes/uw3-local-installation/uw3-env/lib/python3.11/site-packages/sympy-1.12-py3.11.egg/sympy/matrices/common.py#line=2936), in MatrixArithmetic.__sub__(self, a)2935 @call_highest_priority('__rsub__')
2936def__sub__(self, a):
->2937returnself+ (-a)
File [~/Documents/codes/uw3-local-installation/uw3-env/lib/python3.11/site-packages/sympy-1.12-py3.11.egg/sympy/core/decorators.py:106](http://localhost:8888/lab/tree/~/Documents/codes/uw3-local-installation/uw3-env/lib/python3.11/site-packages/sympy-1.12-py3.11.egg/sympy/core/decorators.py#line=105), in call_highest_priority.<locals>.priority_decorator.<locals>.binary_op_wrapper(self, other)104iffisnotNone:
105returnf(self)
-->106returnfunc(self, other)
File [~/Documents/codes/uw3-local-installation/uw3-env/lib/python3.11/site-packages/sympy-1.12-py3.11.egg/sympy/matrices/common.py:2656](http://localhost:8888/lab/tree/~/Documents/codes/uw3-local-installation/uw3-env/lib/python3.11/site-packages/sympy-1.12-py3.11.egg/sympy/matrices/common.py#line=2655), in MatrixArithmetic.__add__(self, other)2653ifgetattr(other, 'is_MatrixLike', False):
2654returnMatrixArithmetic._eval_add(self, other)
->2656raiseTypeError('cannot add %s and %s'% (type(self), type(other)))
TypeError: cannotadd<class'sympy.matrices.dense.MutableDenseMatrix'>and<class'sympy.core.mul.Mul'>
The text was updated successfully, but these errors were encountered:
Describe the bug
I discussed this issue with Louis and reporting it as he requested.
While using the Darcy solve if this line: darcy_solver.constitutive_model.Parameters.s = sympy.Matrix([0, 0]).T, is not there, I am getting this error message.
The text was updated successfully, but these errors were encountered: