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 Loggassume implicit summation over indices repeated twice in a product.v = v k i k ≡ ∑ kv k i k . (2.8)Similarly, a rank two tensor (matrix) quantity A can be represented in termsof unit matrices, that is outer products of unit vectors:A = A ij i i i j ≡ ∑ ∑A ij i i i j . (2.9)i jThis generalizes to tensors of arbitrary rank:C = C ι i ι0 ⊗···⊗i ιr−1 (2.10)≡ ∑ ι 0···∑ι r−1C ι i ι0 ⊗···⊗i ιr−1 , (2.11)where C is a rank r tensor <strong>and</strong> ι is a multiindex of length r.Whenwritingequationsonpaper,amathematiciancaneasilyswitchbetweenthe v <strong>and</strong> v i representations without stating it explicitly. This is possiblebecause of flexible notation <strong>and</strong> conventions. In a programming language, wecan’t use the boldface notation which associates v <strong>and</strong> v by convention, <strong>and</strong>we can’t always interpret such conventions unambiguously. Therefore, <strong>UFL</strong>requiresthatanexpressionisexplicitlymappedfromitstensorrepresentation(v,A) to its component representation (v i , A ij ) <strong>and</strong> back. This is done usingIndex objects, the indexing operator (v[i]), <strong>and</strong> the function as tensor.More details on these follow.In the following descriptions of <strong>UFL</strong> operator syntax, i-l <strong>and</strong> p-s are assumedto be predefined indices, <strong>and</strong> unless otherwise specified the name v refers tosome vector valued expression, <strong>and</strong> the name A refers to some matrix valuedexpression. The name C refers to a tensor expression of arbitrary rank.2.5.1 Defining indicesA set of indices i, j, k, l <strong>and</strong> p, q, r, s are predefined, <strong>and</strong> these shouldbe enough for many applications. Examples will usually use these objectsinstead of creating new ones to conserve space.30

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

Saved successfully!

Ooh no, something went wrong!