If B is a matrix with the same dimension as the number of
degrees of freedom in u,
you can take B*u.vector().array().
Then you let numpy do the matrix vector product.
If you want to let dolfin perform the matrix vector product you
would have to make a dolfin matrix out of B.
If B is a matrix with pointwise values then you should use
B in an Expression.