Error when running examples in tutorial: "Shape mismatch in Sum"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dolfin-adjoint |
Fix Committed
|
Critical
|
Patrick Farrell |
Bug Description
The main purpose of this bug report is to say that the code on the tutorial page [1] is outdated and throws an error when run with dolfin/ufl 1.2.0. The error itself is not related to dolfin-adjoint, but if anybody knows how to fix it anyway that would be appreciated. Otherwise I'll ask on the dolfin/ufl forums and report back here.
This is the error message I get when running the examples in the tutorial (tutorial1.py and tutorial2.py) with dolfin/ufl version 1.2.0:
==>
Solving linear system of size 61 x 61 (PETSc Krylov solver).
Shape mismatch in Sum.
Traceback (most recent call last):
File "tutorial1.py", line 18, in <module>
+ nu*grad(
File "/usr/lib/
return Sum(self, o)
File "/usr/lib/
error("Shape mismatch in Sum.")
File "/usr/lib/
raise self._exception
ufl.log.
<==
As an aside, the meshes in the examples are generated using "UnitInterval", which has been deprecated in dolfin 1.1. The code should be updated to use "UnitInvervalMesh".
Many thanks!
Dear Max,
Thanks for letting me know! I hadn't run the tutorial examples since upgrading to 1.2. I've fixed them all now.
Thanks again,
Patrick