From 07ed96dc6f31c0e05f3f647d3f380fcaf6df8a8a Mon Sep 17 00:00:00 2001 From: Dmitri Naumov <dmitri.naumov@ufz.de> Date: Thu, 10 Oct 2019 17:50:59 +0200 Subject: [PATCH] [MaL] Replace to_radians() with boost's equivalent --- MaterialLib/FractureModels/MohrCoulomb.cpp | 10 +++++++--- MathLib/MathTools.h | 6 ------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/MaterialLib/FractureModels/MohrCoulomb.cpp b/MaterialLib/FractureModels/MohrCoulomb.cpp index a05d098100d..e4a4974398a 100644 --- a/MaterialLib/FractureModels/MohrCoulomb.cpp +++ b/MaterialLib/FractureModels/MohrCoulomb.cpp @@ -8,9 +8,11 @@ */ #include "MohrCoulomb.h" -#include "LogPenalty.h" + +#include <boost/math/constants/constants.hpp> #include "BaseLib/Error.h" +#include "LogPenalty.h" #include "MathLib/MathTools.h" namespace MaterialLib @@ -37,8 +39,10 @@ struct MaterialPropertyValues { Kn = mp.normal_stiffness(t,x)[0]; Ks = mp.shear_stiffness(t,x)[0]; - phi = MathLib::to_radians(mp.friction_angle(t,x)[0]); - psi = MathLib::to_radians(mp.dilatancy_angle(t,x)[0]); + auto constexpr degree = + boost::math::constants::degree<double>(); // pi/180 + phi = mp.friction_angle(t, x)[0] * degree; + psi = mp.dilatancy_angle(t, x)[0] * degree; c = mp.cohesion(t,x)[0]; } }; diff --git a/MathLib/MathTools.h b/MathLib/MathTools.h index f5b0054e8b7..83051ab15cb 100644 --- a/MathLib/MathTools.h +++ b/MathLib/MathTools.h @@ -9,7 +9,6 @@ #pragma once -#include <boost/math/constants/constants.hpp> #include <cstddef> #ifdef _OPENMP @@ -95,11 +94,6 @@ double sqrDist(const double* p0, const double* p1) */ double getAngle (const double p0[3], const double p1[3], const double p2[3]); -/// converts the given degrees to radians -inline double to_radians(double degrees) { - return degrees*boost::math::constants::pi<double>()/180.; -} - template<typename Type> Type limitValueInInterval(const Type variable, const Type lower_bound, const Type upper_bound) -- GitLab