precice / aste

Artificial Solver Testing Environment
GNU General Public License v3.0
10 stars 11 forks source link

Fix gradient calculations #151

Closed kursatyurt closed 1 year ago

kursatyurt commented 1 year ago

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 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