How to correctly write an integral including vector*second-order tensor*vector?

Dear all,

In my case, I have an integral like \int_{\Omega} A\cdot B \cdot C ~\mathrm{d}V, where A is a 2D vector, B is a second-order tensor, and C is a 2D vector as well. Now I need to figure out how to write this integral correctly in Fenics. I have two options, as shown below, but I don’t know which is correct:

variational_form = ( dot(dot(A, B), C) )*dx
#or
variational_form = ( dot(dot(B, A), C) )*dx

Does anyone know which one is correct? I appreciate any help. Thanks very much in advance.

This is very much a math question, not a FEniCS one. If B is a tensor, you’d want first to do B C and get a vector (call it D), and then do A dot D. Hence, I guess you’d want to do dot(A, dot(B, C)).

1 Like

Got it. Thank you very much, Ballarin.