#2533 Mohr Circle: Calculate Element FOS

This commit is contained in:
Rebecca Cox 2018-02-27 14:39:07 +01:00
parent 2d931a81f5
commit 2734f52e53
2 changed files with 27 additions and 1 deletions

View File

@ -291,7 +291,7 @@ void RiuMohrsCirclePlot::addInfoLabel()
textBuilder.append(QString("<b>Friction Angle</b>: %1<br>").arg(m_frictionAngle));
textBuilder.append(QString("<b>Cohesion</b>: %1<br><br>").arg(m_cohesion));
textBuilder.append(QString("<b>Factor of Safety</b>: %1<br>").arg("Coming soon"));
textBuilder.append(QString("<b>Factor of Safety</b>: %1<br>").arg(m_factorOfSafety));
textBuilder.append(QString("<b>&sigma;<sub>1</sub></b>: %1<br>").arg(m_principal1));
textBuilder.append(QString("<b>&sigma;<sub>2</sub></b>: %1<br>").arg(m_principal2));
textBuilder.append(QString("<b>&sigma;<sub>3</sub></b>: %1<br>").arg(m_principal3));
@ -361,6 +361,8 @@ void RiuMohrsCirclePlot::queryDataAndUpdatePlot(RimGeoMechView* geoMechView, siz
cvf::Vec3f principalDirs[3];
cvf::Vec3f elmPrincipals = elmTensor.calculatePrincipals(principalDirs);
setFactorOfSafety(calculateFOS(elmTensor));
setPrincipalsAndRedrawPlot(elmPrincipals[0], elmPrincipals[1], elmPrincipals[2]);
}
@ -529,3 +531,23 @@ bool RiuMohrsCirclePlot::isValidPrincipals(double p1, double p2, double p3)
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
float RiuMohrsCirclePlot::calculateFOS(const caf::Ten3f& tensor)
{
cvf::Vec3f dirs[3];
cvf::Vec3f principals = tensor.calculatePrincipals(dirs);
float se1 = principals[0];
float se3 = principals[2];
float tanFricAng = tan(cvf::Math::toRadians(m_frictionAngle));
float cohPrTanFricAngle = (float)(m_cohesion / tanFricAng);
float pi_4 = 0.785398163397448309616f;
float rho = 2.0f * (atan(sqrt((se1 + cohPrTanFricAngle) / (se3 + cohPrTanFricAngle))) - pi_4);
return tanFricAng / tan(rho);
}

View File

@ -21,6 +21,8 @@
#include "qwt_plot.h"
#include "qwt_plot_item.h"
#include "cafTensor3.h"
#include <array>
class QWidget;
@ -87,6 +89,8 @@ private:
void replotAndScaleAxis();
static bool isValidPrincipals(double p1, double p2, double p3);
float calculateFOS(const caf::Ten3f& tensor);
private:
double m_principal1;