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
Recent changes altered the value shape of symmetric rank-2 tensors, being rank-1 with shape (dim * (dim + 1)/2, ). This means that interpolation of objects with shape (dim, dim) into symmetric rank-2 tensors does not work anymore.
Regge value shape: [2 2]
Psymm value shape: [3]
Traceback (most recent call last):
File "/home/UNILU/symm_interp.py", line 15, in<module>
f0.interpolate(f1)
File "/home/UNILU/dolfinx/python/dolfinx/fem/function.py", line 459, in interpolate
_interpolate(u0)
File "/usr/lib/python3.12/functools.py", line 909, in wrapper
return dispatch(args[0].__class__)(*args, **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/UNILU/dolfinx/python/dolfinx/fem/function.py", line 445, in _
self._cpp_object.interpolate(u0._cpp_object, cells0, cells1) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Interpolation: elements have different value dimensions
Version
main branch
DOLFINx git commit
No response
Installation
No response
Additional information
No response
The text was updated successfully, but these errors were encountered:
I'd say the underlying issue here is that for 3x3 symmetric tensors UFL (or is it now Basix?) reports a value shape of (6,) rather than (3, 3) plus a 'block size' of 6. I left a comment at
// TODO: symmetric rank-2 symmetric tensors are presently constructed
. Before we had a hack where function spaces and elements sometimes reported the same value shape, and sometimes different, and sometimes did some implicit mutations behind the scenes.
The value shape is (3, 3) because they're rank-2 tensors, Symmetry just implies a constraint. We could try a UFL-level fix, or we could try a temporary hack in DOLFINx to address the isssue.
Summarize the issue
Recent changes altered the value shape of symmetric rank-2 tensors, being rank-1 with shape
(dim * (dim + 1)/2, )
. This means that interpolation of objects with shape(dim, dim)
into symmetric rank-2 tensors does not work anymore.See https://github.com/FEniCS/dolfinx/blob/main/cpp/dolfinx/fem/FiniteElement.cpp#L118
How to reproduce the bug
Interpolate into symmetric rank-2 tensors.
Minimal Example (Python)
Output (Python)
Version
main branch
DOLFINx git commit
No response
Installation
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: