Subject: [FFC-dev] 4th order tensors

From: Jake Ostien <[email-masked]>
Date: Mon, 06 Aug 2007 22:24:58 -0400

Hi,

I'd like to construct a 4th order Identity tensor.  I am having some 
trouble trying to figure out if/how FFC handles tensors of higher order
than 2.  If anyone has successfully accomplished this, and would like to 
provide some guidance, it would be appreciated.  Currently I am trying 
to hard-code in 81 terms and I am getting lost in the indices.  A 
similar question would be how numpy handles arrays with more than two 
indices?

Thanks
Jake

---

From: "Garth N. Wells" <[email-masked]>
Date: Tue, 07 Aug 2007 18:12:16 +0200

Jake Ostien wrote:
> to hard-code in 81 terms and I am getting lost in the indices.  

As far as I know, numpy doesn't support higher order identity tensors. 
Even if it did, I would be careful using it since useful higher-order 
tensors typically possess many symmetries. If you don't take this into 
account, you might have to wait a long time for FFC to compute anything.

I know that supporting tensor-valued functions is on the TODO list.

Garth

A
> _______________________________________________
> FFC-dev mailing list
> [email-masked]
> http://www.fenics.org/mailman/listinfo/ffc-dev
>

---

From: Anders Logg <[email-masked]>
Date: Tue, 07 Aug 2007 21:02:16 +0200

>> to hard-code in 81 terms and I am getting lost in the indices.  

Perhaps there is a way to define some operators that will help you 
define the form more compactly? Say you have a function that is a 3x3 
matrix. Then you could do something like

element = VectorElement("Lagrange", "triangle", 1, 9)

def MatrixFunction(element):
    f = Function(element)
    return [[f[0], f[1], f[2]], [f[3], f[4], f[5]], [f[6], f[7], f[8]]

f = MatrixFunction(element)

You could also extend with your own operators for inner products, have 
things like SymmetricMatrixFunction which would just use the upper 6 
triangular values etc.

> I know that supporting tensor-valued functions is on the TODO list.

Yes, at some point, but probably not as part of FFC but as part of UFL 
(Unified Form Language) which will be a separate implementation of the 
form language (that FFC will import).

/Anders