In the gradient calculation, parenthesis was missing which led to a wrong calculation.
eg.
(y-x)^2 should have a gradient (2*x-2y)*iHat+(-2*x+2y)*jHat+0*kHat but get a gradient 2*x - 2*y*iHat+-2*x + 2*y*jHat+0*kHat as a function which is not a vector equivalent to -2*y*iHat+2*y*jHat+0*kHat + (2*x-2*x) which is not a vector.
Author's checklist
[x] I used the pre-commit hook and used pre-commit run --all to apply all available hooks.
[x] I added a test to cover the proposed changes in our test suite.
[ ] I updated the documentation in docs/README.md.
Main changes of this PR
In the gradient calculation, parenthesis was missing which led to a wrong calculation.
eg.
(y-x)^2
should have a gradient(2*x-2y)*iHat+(-2*x+2y)*jHat+0*kHat
but get a gradient2*x - 2*y*iHat+-2*x + 2*y*jHat+0*kHat
as a function which is not a vector equivalent to-2*y*iHat+2*y*jHat+0*kHat + (2*x-2*x)
which is not a vector.Author's checklist
pre-commit
hook and usedpre-commit run --all
to apply all available hooks.docs/README.md
.precice/tutorials/aste-turbine
.