From 3bc981b72c6f03471fb867d58e77cb6ccef19c14 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Wed, 3 Jul 2013 15:55:06 +0000 Subject: [PATCH] fix more malcomputed derivatives. The test passes now [[Imported from SVN: r9281]] --- dune/gfe/hyperbolichalfspacepoint.hh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dune/gfe/hyperbolichalfspacepoint.hh b/dune/gfe/hyperbolichalfspacepoint.hh index 634ef5c8..f7f33580 100644 --- a/dune/gfe/hyperbolichalfspacepoint.hh +++ b/dune/gfe/hyperbolichalfspacepoint.hh @@ -392,7 +392,8 @@ public: } else if (i==N-1 and j==N-1 and k==N-1) { - dFdqdqdq[i][j][k] = (-1 -6*p[N-1] + 4*q[N-1] -3*diffNormSquared)/(p[N-1]*Dune::Power<3>::eval(q[N-1])); + dFdqdqdq[i][j][k] = -2/Dune::Power<3>::eval(q[N-1]) - 1/(p[N-1]*q[N-1]*q[N-1]) - 4*(p[N-1]-q[N-1])/(p[N-1]*Dune::Power<3>::eval(q[N-1])) + - 3*diffNormSquared / (p[N-1]*Dune::Power<4>::eval(q[N-1])); } @@ -471,18 +472,18 @@ public: } else if (i==N-1 and j!=N-1 and k==N-1) { - dFdpdqdq[i][j][k] = 2*(p[j] - q[j]) / (p[N-1]*Dune::Power<3>::eval(q[N-1])); + dFdpdqdq[i][j][k] = -(p[j] - q[j]) / (p[N-1]*p[N-1]*Dune::Power<2>::eval(q[N-1])); } else if (i==N-1 and j==N-1 and k!=N-1) { - dFdpdqdq[i][j][k] = 2*(p[k] - q[k]) / (p[N-1]*Dune::Power<3>::eval(q[N-1])); + dFdpdqdq[i][j][k] = -(p[k] - q[k]) / (p[N-1]*p[N-1]*Dune::Power<2>::eval(q[N-1])); } else if (i==N-1 and j==N-1 and k==N-1) { - dFdpdqdq[i][j][k] = 1.0/(p[N-1]*p[N-1]*q[N-1]*q[N-1]) + 1.0/(p[N-1]*q[N-1]*q[N-1]) + dFdpdqdq[i][j][k] = 1.0/(p[N-1]*q[N-1]*q[N-1]) + 2*(p[N-1]-q[N-1])/(p[N-1]*Dune::Power<3>::eval(q[N-1])) - + 2*(p[N-1]-q[N-1])/(p[N-1]*p[N-1]*q[N-1]) - - diffNormSquared / (p[N-1]*p[N-1]*q[N-1]*q[N-1]); + - (p[N-1]-q[N-1])/(p[N-1]*p[N-1]*q[N-1]*q[N-1]) + - diffNormSquared / (p[N-1]*p[N-1]*Dune::Power<3>::eval(q[N-1])); } -- GitLab