From c1a4b11d8eaa81904e1480ae8f1527971aebbffd Mon Sep 17 00:00:00 2001
From: Sebastian Eibl <sebastian.eibl@fau.de>
Date: Tue, 30 Jul 2019 17:00:25 +0200
Subject: [PATCH] [ADD] check for cor and collision time

---
 tests/mesa_pd/kernel/SpringDashpot.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests/mesa_pd/kernel/SpringDashpot.cpp b/tests/mesa_pd/kernel/SpringDashpot.cpp
index c9108e5ae..c367ef36d 100644
--- a/tests/mesa_pd/kernel/SpringDashpot.cpp
+++ b/tests/mesa_pd/kernel/SpringDashpot.cpp
@@ -124,6 +124,15 @@ int main( int argc, char ** argv )
                                        real_t(101) * Vec3(1,1,1).getNormalized() * ((std::sqrt(real_t(12)) - 4) * sd.getStiffness(0, 0)),
                                        real_t(1e-6) );
 
+   auto cor  = real_t(0.87);
+   auto ct   = real_t(0.17);
+   auto meff = real_t(0.65);
+   sd.setParametersFromCOR(0, 0, cor, ct, meff);
+   //WALBERLA_CHECK_FLOAT_EQUAL(sd.getStiffness(0,0), (math::M_PI*math::M_PI - std::log(cor)*std::log(cor)) / (ct*ct) * meff);
+   //WALBERLA_CHECK_FLOAT_EQUAL(sd.getDampingN(0,0),  -real_t(2)*std::log(cor)/ct*meff);
+   WALBERLA_CHECK_FLOAT_EQUAL(sd.calcCoefficientOfRestitution(0, 0, meff), cor);
+   WALBERLA_CHECK_FLOAT_EQUAL(sd.calcCollisionTime(0, 0, meff), ct);
+
    return EXIT_SUCCESS;
 }
 
-- 
GitLab