We had our earlier scatter kernel as follows:
coords[iel, i_bf, i_dim] = coords_global[ltg[iel, i_bf], i_dim]
And coords
being implemented as a 3-dimensional array in the element kernel. This was not a problem.
But the "new" tsfc
element kernel, flatten out the 3rd dimension of coords
. Making the the coords
a 2-dimensional array in the element kernel.
Hence, I would need to change the scatter kernel. So I tried 2 approaches to this problem:
- Making the new scatter kernel look like:
coords[iel, dim*i_bf + i_dim] = coords_global[ltg[iel, i_bf], i_dim]
But the assignment to substitution over here starts to complain. As the LHS
in of the assignment is expected to have indices
free of any expressions.
- Defining the a "new"
iname
:
coords[iel, i_bf_dim] = coords_global[ltg[iel, i_bf], i_bf_dim - dim*i_bf]
This would get me through with the assignment_to_substion(...)
, but then we would encounter some reductions which are independent of involved inames
. Precisely the error being instruction 'sum_tmp_i10_update' references inames 'i_bf_0' that the instruction does not depend on
.
A side note: coords
is just an example. This change is needed for all the arguments that are given to the loopy kernel.