13.07.2015 Views

UFL Specification and User Manual 0.3 - FEniCS Project

UFL Specification and User Manual 0.3 - FEniCS Project

UFL Specification and User Manual 0.3 - FEniCS Project

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>UFL</strong> <strong>Specification</strong> <strong>and</strong> <strong>User</strong> <strong>Manual</strong> <strong>0.3</strong>Martin S. Alnæs, Anders LoggAn example with a tensor of rank twoA·B = (A ij i i i j )·(B kl i k i l ) (2.19)This is the same as to matrix-matrix multiplication.An example with a vector <strong>and</strong> a tensor of rank two= (A ij B kl )i i (i j ·i k )i l (2.20)= (A ij B kl δ jk )i i i l (2.21)= A ik B kl i i i l . (2.22)v·A = (v j i j )·(A kl i k i l ) (2.23)This is the same as to vector-matrix multiplication.= (v j A kl )(i j ·i k )i l (2.24)= (v j A kl δ jk )i l (2.25)= v k A kl i l (2.26)This generalizes to tensors of arbitrary rank: The dot product applies tothe last axis of a <strong>and</strong> the first axis of b. The tensor rank of the product isrank(a)+rank(b)-2.2.8.4 innerThe inner product is a contraction over all axes of a <strong>and</strong> b, that is the sumof all componentwise products. The oper<strong>and</strong>s must have the exact samedimensions. For two vectors it is equivalent to the dot product.If A <strong>and</strong> B are rank 2 tensors <strong>and</strong> C <strong>and</strong> D are rank 3 tensors their innerproducts areA : B = A ij B ij (2.27)C : D = C ijk D ijk (2.28)Using <strong>UFL</strong> notation, the following pairs of declarations are equivalent38

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!