From 2c3341c41fc65709250e49dcf1d56d0fbdfa7a0a Mon Sep 17 00:00:00 2001 From: Sebastian Eibl <sebastian.eibl@fau.de> Date: Tue, 30 Jul 2019 17:12:21 +0200 Subject: [PATCH] [FIX] math::M_PI -> math::pi --- src/mesa_pd/collision_detection/EPA.cpp | 2 +- src/mesa_pd/data/shape/Ellipsoid.h | 2 +- tests/mesa_pd/collision_detection/GJK_EPA.cpp | 2 +- tests/mesa_pd/kernel/SpringDashpot.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mesa_pd/collision_detection/EPA.cpp b/src/mesa_pd/collision_detection/EPA.cpp index 2076f6806..304b4e6f1 100644 --- a/src/mesa_pd/collision_detection/EPA.cpp +++ b/src/mesa_pd/collision_detection/EPA.cpp @@ -553,7 +553,7 @@ inline void EPA::createInitialSimplex( size_t numPoints, } Vec3 direction1 = (d % axis).getNormalizedOrZero(); - Quat q(d, (real_t(2.0)/real_t(3.0)) * real_t(walberla::math::M_PI)); + Quat q(d, (real_t(2.0)/real_t(3.0)) * real_t(walberla::math::pi)); Mat3 rot = q.toRotationMatrix(); Vec3 direction2 = (rot*direction1).getNormalizedOrZero(); Vec3 direction3 = (rot*direction2).getNormalizedOrZero(); diff --git a/src/mesa_pd/data/shape/Ellipsoid.h b/src/mesa_pd/data/shape/Ellipsoid.h index 6ab1d673a..9a07488e3 100644 --- a/src/mesa_pd/data/shape/Ellipsoid.h +++ b/src/mesa_pd/data/shape/Ellipsoid.h @@ -38,7 +38,7 @@ public: const Vec3& getSemiAxes() const { return semiAxes_; } - real_t getVolume() const override { return real_c(4.0/3.0) * math::M_PI * semiAxes_[0] * semiAxes_[1] * semiAxes_[2]; } + real_t getVolume() const override { return real_c(4.0/3.0) * math::pi * semiAxes_[0] * semiAxes_[1] * semiAxes_[2]; } void updateMassAndInertia(const real_t density) override; Vec3 support( const Vec3& d_loc ) const override; diff --git a/tests/mesa_pd/collision_detection/GJK_EPA.cpp b/tests/mesa_pd/collision_detection/GJK_EPA.cpp index c9eb7921d..4cbfdc0b6 100644 --- a/tests/mesa_pd/collision_detection/GJK_EPA.cpp +++ b/tests/mesa_pd/collision_detection/GJK_EPA.cpp @@ -200,7 +200,7 @@ void MainTest() //Testcase 04 Cube with turned Cube WALBERLA_LOG_INFO("Test 04: CUBE <-> TURNED CUBE"); //compute rotation. - real_t angle = walberla::math::M_PI/real_t(4.0); + real_t angle = walberla::math::pi/real_t(4.0); Vec3 zaxis(0, 0, 1); Quat q4(zaxis, angle); diff --git a/tests/mesa_pd/kernel/SpringDashpot.cpp b/tests/mesa_pd/kernel/SpringDashpot.cpp index c367ef36d..8bd82ee16 100644 --- a/tests/mesa_pd/kernel/SpringDashpot.cpp +++ b/tests/mesa_pd/kernel/SpringDashpot.cpp @@ -128,7 +128,7 @@ int main( int argc, char ** argv ) 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.getStiffness(0,0), (math::pi*math::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); -- GitLab