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
Describe the bug Cofunction.interpolate fails if used for self-assignment.
Steps to Reproduce
import firedrake as fd
mesh = fd.UnitIntervalMesh(1)
space = fd.FunctionSpace(mesh, "DG", 0)
u = fd.Cofunction(space.dual(), name="u")
u.interpolate(u)
leads to error
Traceback (most recent call last):
File "/home/jmaddis2/test.py", line 6, in <module>
u.interpolate(u)
File "/home/jmaddis2/build/firedrake/firedrake/src/firedrake/firedrake/cofunction.py", line 317, in interpolate
return firedrake.assemble(interp, tensor=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "petsc4py/PETSc/Log.pyx", line 188, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
File "petsc4py/PETSc/Log.pyx", line 189, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
File "/home/jmaddis2/build/firedrake/firedrake/src/firedrake/firedrake/adjoint_utils/assembly.py", line 30, in wrapper
output = assemble(form, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jmaddis2/build/firedrake/firedrake/src/firedrake/firedrake/assemble.py", line 134, in assemble
return get_assembler(expr, *args, **kwargs).assemble(tensor=tensor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jmaddis2/build/firedrake/firedrake/src/firedrake/firedrake/assemble.py", line 382, in assemble
result = BaseFormAssembler.base_form_postorder_traversal(self._form, visitor, visited)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jmaddis2/build/firedrake/firedrake/src/firedrake/firedrake/assemble.py", line 605, in base_form_postorder_traversal
visited[e] = visitor(e, *(visited[arg] for arg in operands))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jmaddis2/build/firedrake/firedrake/src/firedrake/firedrake/assemble.py", line 378, in visitor
return self.base_form_assembly_visitor(e, t, *operands)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jmaddis2/build/firedrake/firedrake/src/firedrake/firedrake/assemble.py", line 545, in base_form_assembly_visitor
return interpolator._interpolate(v, output=output, transpose=True, default_missing_val=default_missing_val)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "petsc4py/PETSc/Log.pyx", line 188, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
File "petsc4py/PETSc/Log.pyx", line 189, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
File "/home/jmaddis2/build/firedrake/firedrake/src/firedrake/firedrake/interpolation.py", line 862, in _interpolate
mul(x, out)
File "petsc4py/PETSc/Mat.pyx", line 3760, in petsc4py.PETSc.Mat.multTranspose
petsc4py.PETSc.Error: error code 73
[0] MatMultTranspose() at /home/jmaddis2/build/firedrake/firedrake/src/petsc/src/mat/interface/matrix.c:2710
[0] Object is in wrong state
[0] x and y must be different vectors
Expected behavior
Operation should have no effect.
Environment:
Ubuntu 24.04
The text was updated successfully, but these errors were encountered:
Describe the bug
Cofunction.interpolate
fails if used for self-assignment.Steps to Reproduce
leads to error
Expected behavior
Operation should have no effect.
Environment:
Ubuntu 24.04
The text was updated successfully, but these errors were encountered: