← Back to team overview

ufl team mailing list archive

Dyadic notation

 

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


Follow ups