Open gmarkall opened 12 years ago
In the example, the div(u) is the problem - it computes an IndexSum of the SpatialDerivative of the Coefficient u - however, there is no argument that is equal to Argument(u.element()).
In https://github.com/gmarkall/manycore_form_compiler/commit/3e4cb3202055933c7bca09f3a1353594c26f5925 there is a potential fix - this is to use the scalar basis parameter whenever we have a coefficient on a vector basis. I wonder if this is adequate up until the time when we use fiat-tabulated basis functions? It allows the code for rk4-advection to be generated, but there are some unrelated issues in the generated code.
I think this has been solved as a by-product of eliminating the KernelParameterGenerator
. Now coefficients are not tied to argument any more for parameter generation.
Above commit seems to have been cleaned up.
At the moment, there is an assumption (not explicitly written, but encoded in the logic) in the generate() function in parameters.py that all of the Coefficients have the same basis as the test or trial functions (Arguments) in the form.
This is because, after traversing the tree to find out which derivatives are present, it builds a list of derivatives called argumentDerivatives. This contains a list of SpatialDerivatives of Arguments with the element of the Coefficient that had its derivative taken (see lines 63-80). However, there wasn't necessarily an argument in the original form which had the same element.
This causes a problem because the last loop in generate(), which generates the parameters for the spatial derivatives, (line 109-125), tries to find the very same argument in formArguments, which doesn't necessarily exist.
This problem can be triggered by:
I'm just starting to think about the correct thing to do to make this work - somehow we need to generate the parameters for spatial derivatives of Coefficients, even when there wasn't an Argument with the same basis.