Closed mmorandi closed 4 months ago
@mscroggs
The issue here is that we use u.function_space().value_size()
within interpolate, which is (6, 6), while the basix element reference-value-shape is (21, ).
Similarly, the value size is 36.
What would be the best thing to do here?
Following #3158, the first option for interpolation into a symmetric element will now be correct rather than doing something incorrect, ie:
mat_modulus_symm1.interpolate(lambda x: tensor(x, mat), domain)
print(mat_modulus_symm1.x.array)
This fix will be included in the 0.8 release.
I'd like to get the second option working too. I've opened #3159 for this, with a unit test for this included
Just to be clear, what happens if with option 1 you pass a full array which is non-symmetric ?
Just to be clear, what happens if with option 1 you pass a full array which is non-symmetric ?
It just looks at the lower part of the matrix and ignores the upper part. Maybe we need an issue to change this at some point
I've opened an issue to discuss how to handle this case: https://github.com/FEniCS/dolfinx/issues/3165
(edit: swapped upper and lower)
Summarize the issue
Consider the attached test case. Interpolate is asking for 36 numbers even if the tensor is symmetric. If one passes a full tensor (
mat_modulus_symm1.interpolate
) then it silently truncates the tensor; if, on the other hand, one passes the upper triangular portion of the tensor components (mat_modulus_symm2.interpolate
), then it bails outHow to reproduce the bug
Check the reproducer below
Minimal Example (Python)
Output (Python)
Version
0.7.3
DOLFINx git commit
b488a495d3d74a048e5866f437f2df20b075d907
Installation
conda on a linux box
Additional information
No response