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 Logg2.5.2 Taking components of tensorsBasic fixed indexing of a vector valued expression v or matrix valued expressionA:• v[0]: component access, representing the scalar value of the first componentof v• A[0,1]: component access, representing the scalar value of the firstrow, second column of ABasic indexing:• v[i]: component access, representing the scalar value of some componentof v• A[i,j]: component access, representing the scalar value of some componenti,j of AMore advanced indexing:• A[i,0]: component access, representing the scalar value of some componenti of the first column of A• A[i,:]: row access, representing some row i of A, i.e. rank(A[i,:]) ==1• A[:,j]: columnaccess,representingsomecolumnjofA,i.e. rank(A[:,j])== 1• C[...,0]: subtensor access, representing the subtensor of A with thelast axis fixed, e.g., A[...,0] == A[:,0]• C[j,...]: subtensor access, representing the subtensor of A with thelast axis fixed, e.g., A[j,...] == A[j,:]32

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

Saved successfully!

Ooh no, something went wrong!