gmarkall / manycore_form_compiler

MCFC is deprecated. See https://code.launchpad.net/~grm08/ffc/pyop2
https://code.launchpad.net/~grm08/ffc/pyop2
GNU General Public License v3.0
3 stars 1 forks source link

Add support for ListTensor to ExpressionBuilder. #57

Closed kynan closed 12 years ago

kynan commented 12 years ago

A ListTensor wraps a list of expressions into a tensor valued expression of one higher rank. This commit adds supported for these to MCFC.

When a ListTensor is encountered in the expression tree, capture its subordinated expressions and build an initialiser for a fixed size of the dimension of the ListTensor with these expressions. Push this initialiser on a subexpression stack.

Subscript this array with an index over dimensions and push that on the expression stack. In the loop over dimensions for the expression, the appropriate expression of the ListTensor is thereby accessed.

Add a test case based on the Euler-advection test.

Note: This has only been tested with scalar expressions below the ListTensor and may well break for higher rank.

gmarkall commented 12 years ago

This looks good - I really like how simple a solution it is to the problem! I had been dreading looking into it.

The only thing that I think we're missing is swapped-advection.ufl