Skip to content
Snippets Groups Projects
Commit f3ae8bdb authored by Norihiro Watanabe's avatar Norihiro Watanabe
Browse files

use boost::math::sign()

parent 565036df
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,10 @@
#include "BaseLib/Error.h"
#include "MathLib/MathTools.h"
#ifndef Q_MOC_RUN // to avoid Qt4 bug, https://bugreports.qt.io/browse/QTBUG-22829
#include <boost/math/special_functions/sign.hpp>
#endif
namespace MaterialLib
{
namespace Fracture
......@@ -86,12 +90,12 @@ void MohrCoulomb<DisplacementDim>::computeConstitutiveRelation(
}
Eigen::VectorXd dFs_dS(2);
dFs_dS[0] = MathLib::sgn(sigma[0]);
dFs_dS[0] = boost::math::sign(sigma[0]);
dFs_dS[1] = std::tan(mat.phi);
// plastic potential function: Qs = |tau| + Sn * tan da
Eigen::VectorXd dQs_dS(2);
dQs_dS[0] = MathLib::sgn(sigma[0]);
dQs_dS[0] = boost::math::sign(sigma[0]);
dQs_dS[1] = std::tan(mat.psi);
// plastic multiplier
......
......@@ -115,11 +115,6 @@ double sqrDist(const double* p0, const double* p1)
*/
double getAngle (const double p0[3], const double p1[3], const double p2[3]);
/// sign function
template <typename T> int sgn(T val) {
return (T(0) < val) - (val < T(0));
}
/// converts the given degrees to radians
inline double to_radians(double degrees) {
return degrees*boost::math::constants::pi<double>()/180.;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment