← Back to team overview

ffc team mailing list archive

Re: 4th order tensors

 

Garth N. Wells wrote:
Jake Ostien wrote:
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.

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.

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.

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


Garth


A
similar question would be how numpy handles arrays with more than two indices?

Thanks
Jake
_______________________________________________
FFC-dev mailing list
FFC-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/ffc-dev



_______________________________________________
FFC-dev mailing list
FFC-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/ffc-dev


References