evaluatebasisderivatives giving corrupt result due to wrong size of derivatives_p
Line 578 of evaluatebasisderivatives.py seems to be wrong.
Comments (9)
-
reporter -
This line?
https://bitbucket.org/fenics-project/ffc/src/502d0b3384fe3e3c149d7b971b5a211cded92b9d/ffc/evaluatebasisderivatives.py?at=master&fileviewer=file-view-default#evaluatebasisderivatives.py-578
-
-
reporter It seems to me that there is a simple fix: getting the correct size of
derivatives_p
. From the look of things, Line 578:nds = tdim**max_degree * gdim
should bends = gdim**max_degree * num_components
. But I may be wrong? -
reporter OK, maybe I am wrong there. It seems that the 'covariant piola' and 'contravariant piola' should copy into an array of size
gdim*num_derivatives
, whereas the 'double contra/co variant piola' copy into an array of sizenum_components*num_derivatives
. Is that correct? It looks like the line 571if "piola" in mapping:
is incorrectly setting the wrong size for the 'double piola' transformations... -
Have you looked at the code here? https://bitbucket.org/fenics-project/ffc/src/502d0b3384fe3e3c149d7b971b5a211cded92b9d/ffc/uflacs/backends/ufc/finite_element.py?at=master&fileviewer=file-view-default#finite_element.py-157
I believe I handled this issue correctly in the new
transform_reference_basis_derivatives
. -
Although it's untested...
-
reporter Yes, clearly it would be good to reuse your new code where possible, and there is a lot of refactoring still to do. I just wanted to get the reference version correct using the old code first, if possible.
-
reporter - changed status to resolved
now fixed.
- Log in to comment
In the generated code,
derivatives_p[]
is declared with the wrong size, and overwrites thetransform
matrix. @blechta, @martinal - can you check? What is correct expression for size of derivatives_p ....?