Mohr circle: Use same function to calculate FOS (=1/dsm) in results collection and mohrs plot

This commit is contained in:
Rebecca Cox
2018-03-06 10:29:04 +01:00
parent d92918d11e
commit c77c08222d
3 changed files with 26 additions and 15 deletions

View File

@@ -531,21 +531,20 @@ bool RiuMohrsCirclePlot::isValidPrincipals(const cvf::Vec3f& principals)
//--------------------------------------------------------------------------------------------------
float RiuMohrsCirclePlot::calculateFOS(const cvf::Vec3f& principals, double frictionAngle, double cohesion)
{
float se1 = principals[0];
float se3 = principals[2];
if (cvf::Math::cos(frictionAngle) == 0)
{
return 0.0f;
return std::nan("");
}
float se1 = principals[0];
float se3 = principals[2];
float tanFricAng = cvf::Math::tan(cvf::Math::toRadians(frictionAngle));
float cohPrTanFricAngle = 1.0f * cohesion / tanFricAng;
float pi_4 = 0.785398163397448309616f;
float rho = 2.0f * (cvf::Math::atan(cvf::Math::sqrt((se1 + cohPrTanFricAngle) / (se3 + cohPrTanFricAngle))) - pi_4);
float dsm = RigFemPartResultsCollection::dsm(se1, se3, tanFricAng, cohPrTanFricAngle);
return tanFricAng / cvf::Math::tan(rho);
return 1.0f / dsm;
}
//--------------------------------------------------------------------------------------------------