Subject: [UFL-dev] Dyadic notation

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Mon, 14 Jan 2008 21:31:03 +0100

I suggest adding dyadic notation to UFL as well, something like:

ei(i) -> unit vector in direction i
eij(i,j) -> unit 2nd order tensor in direction i,j

i.e. eij(i,j) == outer(ei(i), ej(j))

# defining a vector by adding components:
uu = u*ei(0) + v*ei(1) + w*ei(2)

# defining a diagonal matrix:
sigma_0 = T * (a*eii(0,0) + b*eii(1,1) + c*eii(2,2))

# defining a direction vector from an angle:
d = cos(theta)*ei(0) + sin(theta)*ei(1)

--
Martin

---

From: Anders Logg <[email-masked]>
Date: Mon, 14 Jan 2008 23:23:41 +0100

> d = cos(theta)*ei(0) + sin(theta)*ei(1)

Sounds good.

How does one write the identity matrix?

-- 
Anders

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Mon, 14 Jan 2008 23:37:20 +0100

> How does one write the identity matrix?

Either one of these should work:
  dij = dot(e(i), e(j)) # Kronecker delta
  I = outer(ei(i), ei(i)) # sum of outer products of ei(i) with
itself, ie sum of eij(i,i) for all i

But we can still have "I = Id()" or similar for that one.

(Note that I don't see all the details of the index notation
implementation clearly yet).

--
Martin

---

From: Kent-Andre Mardal <[email-masked]>
Date: Tue, 15 Jan 2008 14:51:19 +0100

> implementation clearly yet).

Great, we also need this (or something similar) if we implement the
exterior calculus with UFL. 

Kent