Closed gmarkall closed 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:
numGaussPoints
for a GaussIndex
numDimensions
for a DimIndex
numNodesPerEle
for a BasisIndex
There's several issues with this approach:
Element
. The current abstraction is flawed in this point.FormBackend
makes it difficult to build arbitrary expressions (see #51)So, it looks like:
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.
Fixed by 3ed68d1e3a
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).