From 7f326dedeb313ca5155b9a10c023f87905f4f39a Mon Sep 17 00:00:00 2001
From: Oliver Sander <oliver.sander@tu-dresden.de>
Date: Mon, 19 Feb 2018 13:51:36 +0100
Subject: [PATCH] Fix scaling of the FD gradient used for testing

The formula for the FD gradient never took the distance between
the two Lagrange points into account, even though the gradient
of an interpolation function clearly depends on it.
---
 test/rotationtest.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/test/rotationtest.cc b/test/rotationtest.cc
index 5f3dc553..432a6bfc 100644
--- a/test/rotationtest.cc
+++ b/test/rotationtest.cc
@@ -181,6 +181,10 @@ void testDerivativeOfInterpolatedPosition()
                         
                     }
                     
+                    // Scale the finite difference gradient with the interval length
+                    for (auto& parDer : fdGrad)
+                        parDer /= intervalLength;
+
                     // Compute analytical velocity vector gradient
                     RodLocalStiffness<OneDGrid,double>::interpolationVelocityDerivative(q[i], q[j], s, intervalLength, grad);
                     
-- 
GitLab