how to efficiently define an expression in dolfinx. The expression there is scalar-valued, and the x variable is treated as an array with all coordinates to which the scalar expression is applied. When trying to define an Expression which is matrix-valued (for every interpolation point), the approach in that post becomes difficult to handle, at least with my knowledge. So my question is, how to define an Expression in dolfinx to define a space-dependent, matrix-valued coefficient?
For a three dimensional tensor, you would therefore define the shape (9, x.shape[1]) where the 0th entry corresponds to [0,0] the 1st entry to [0,1], 2nd [0,2] 3rd to [1,0] etc.