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

In branch global-vector-assembly, BasisIndex objects are being constructed with the wrong extent #50

Closed gmarkall closed 12 years ago

gmarkall commented 12 years ago

E.g. in identity-vector, the Local tensor expressions look like:

localTensor[((i_ele + n_ele * i_r_0) + 3 * n_ele * i_r_1)] = 0.0;

That should be 6 * n_ele * ..., not 3 * n_ele * ...

The root of the problem is that basis indices are only constructed using a count, and they are not given the relevant element for the basis functions that they are iterating over. They need to be passed the element, so that they know whether they are indexing over a FiniteElement, VectorElement etc. to choose the correct upper bound for the index.

(This is next on my list to fix - just keeping track of it here).

kynan commented 12 years ago

That's a symptom of a more general issue: Our current construction of the various indices in the backend is not ideal. Upon construction of an index, its extent is set to a related attribute of the form:

There's several issues with this approach:

gmarkall commented 12 years ago

So, it looks like:

kynan commented 12 years ago

I don't like the thought of adding an additional parameter too much, but I don't see a way around it at the moment. It's tricky to set defaults if the constructors are not bound to an object (which we'd ideally want) to take the default from. That may be a problem for the gauss index - it is going to be tricky to supply the parameter when constructing the index.

gmarkall commented 12 years ago

Fixed by 3ed68d1e3a