Open glumpshikt opened 1 year ago
The issue can be worked around if the line evaluation=gem.optimise.contraction(evaluation)
in FInAT/finat/tensorfiniteelement.py is commented out
Thanks. @ReubenHill this could be treated as part of the continuing work on dual evaluation? When we implemented it for tensor product elements, we used a "big hammer" to optimise the contractions, but really needed to do a better job (as indicated here).
What do you think the right thing to do would be? I wonder how many free indices it's finding...
More than six iirc (since 6! = 720 which was considered to be "big enough for anyone").
It's been a while since I thought about this, but I think the right way to try and optimise the contractions is to first evaluate F_q := f(x_q)
and then optimise the change of basis contraction Q F_q
. This, I think, gives at least an asymptotically correct algorithmic complexity. But right now we just hand over Q f(x_q)
which has many indices.
Shouldn't GEM be clever enough to do the pre-evaluation like that itself? It also won't work when x_q
is to be specified at runtime no?
Shouldn't GEM be clever enough to do the pre-evaluation like that itself? It also won't work when
x_q
is to be specified at runtime no?
GEM is declarative, so doesn't do any optimisation (except some minimal amount of constant folding).
What I mean is that the interpolation is two steps:
Q
matrix.Each of those steps needs to separately have contractions optimised I think.
Hello. I've noticed that the interpolation function fails for some indexed expressions. In the code below, lines 11-14 work as intended but 15-16 throw an error (shown below). When line 4
mesh = ExtrudedMesh(mesh,5)
is commented out, all expressions work as intended.