← Back to team overview

ufl team mailing list archive

Re: Dyadic notation

 

2008/1/14, Anders Logg <logg@xxxxxxxxx>:
> On Mon, Jan 14, 2008 at 09:31:03PM +0100, Martin Sandve Alnæs wrote:
> > 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)
>
> Sounds good.
>
> How does one write the identity matrix?
>
> --
> Anders

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


Follow ups

References