Please note that you need to define a mesh and then project the multiplication on a VectorFunctionSpace
as the output result is a vector. In order to perform the multiplication, you can use dot symbol.
\Rightarrow More information about different types of multiplications are available in UFL User Manual
Here is an example of what you want to do:
from fenics import *
mesh = RectangleMesh(Point(0., 0.),Point(1, 1),1,1)
mat = as_matrix([[1,1],
[1,1]])
vec = as_vector([2,3])
result = dot(mat,vec)
V = VectorFunctionSpace(mesh, 'CG', 1)
component = project(result, V)
print("The first component is: " , component.vector().get_local()[0])
print("The second component is: " , component.vector().get_local()[1])
Where the output is:
The first component is: 5.000000000000007
The second component is: 5.000000000000007