-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LiteralFloat with value Zero
not supported in compilation of integral
#699
Comments
The issue might be: Line 225 in 17045ea
|
Or it seems like some optimization of zeros is not applied: import basix.ufl
import ufl
c_el = basix.ufl.element("Lagrange", "triangle", 1, shape=(2,))
mesh = ufl.Mesh(c_el)
C = ufl.as_tensor([[0, 0], [0, 1]])
int = ufl.transpose(C)[0, 0]
# int = C[0, 0]
dx = ufl.Measure("dx", domain=mesh)
J = int * dx
forms = [J] This should be reduced to 0s, but it doesn't seem like it is. |
Is this a problem only because the value is zero. The kernel works with non-zero values in |
Yes, it is only an issue when C[0,0] is 0. |
Zero
not supported in compilation of integral
An optimization won't be applied in this case, that is expected (UFL does not zero parts of expression tree at the granularity of each component). For expression you should see the 0.0 multiplication in the generated code? I think what happens is https://github.com/FEniCS/ffcx/blob/main/ffcx/codegeneration/lnodes.py#L98 triggers and |
I don't think this will work, as the value 0.0 is still neither a Symbol, nor have an array property, and it will fail in the same place. We could cut out those lines in https://github.com/FEniCS/ffcx/blob/main/ffcx/codegeneration/lnodes.py#L98 - then it will just return |
Thats sounds good. It will avoid extra work to check for possibly unused quadrature tables. |
MWE:
Traceback
Issue first reported at
https://fenicsproject.discourse.group/t/asemble-scalar-error-literalfloat-no-array-attribute/14807?u=dokken
The text was updated successfully, but these errors were encountered: