#912 Added Mean Stress (SM)

This commit is contained in:
Jacob Støren
2016-10-11 12:12:10 +02:00
parent aa6cc5a861
commit 1a920338cc
3 changed files with 44 additions and 1 deletions

View File

@@ -203,6 +203,8 @@ std::map<std::string, std::vector<std::string> > RigFemPartResultsCollection::sc
fieldCompNames["ST"].push_back("S2");
fieldCompNames["ST"].push_back("S3");
fieldCompNames["SM"];
fieldCompNames["Gamma"].push_back("Gamma1");
fieldCompNames["Gamma"].push_back("Gamma2");
fieldCompNames["Gamma"].push_back("Gamma3");
@@ -241,6 +243,8 @@ std::map<std::string, std::vector<std::string> > RigFemPartResultsCollection::sc
fieldCompNames["ST"].push_back("S2");
fieldCompNames["ST"].push_back("S3");
fieldCompNames["SM"];
fieldCompNames["Gamma"].push_back("Gamma1");
fieldCompNames["Gamma"].push_back("Gamma2");
fieldCompNames["Gamma"].push_back("Gamma3");
@@ -362,6 +366,39 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateTimeLapseResult(
return dstDataFrames;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigFemScalarResultFrames* RigFemPartResultsCollection::calculateMeanStressSM(int partIndex, const RigFemResultAddress& resVarAddr)
{
CVF_ASSERT(resVarAddr.fieldName == "SM");
RigFemScalarResultFrames * sa11 = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "S-Bar", "S11"));
RigFemScalarResultFrames * sa22 = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "S-Bar", "S22"));
RigFemScalarResultFrames * sa33 = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "S-Bar", "S33"));
RigFemScalarResultFrames * dstDataFrames = m_femPartResults[partIndex]->createScalarResult(resVarAddr);
int frameCount = sa11->frameCount();
for(int fIdx = 0; fIdx < frameCount; ++fIdx)
{
const std::vector<float>& sa11Data = sa11->frameData(fIdx);
const std::vector<float>& sa22Data = sa22->frameData(fIdx);
const std::vector<float>& sa33Data = sa33->frameData(fIdx);
std::vector<float>& dstFrameData = dstDataFrames->frameData(fIdx);
size_t valCount = sa11Data.size();
dstFrameData.resize(valCount);
for(size_t vIdx = 0; vIdx < valCount; ++vIdx)
{
dstFrameData[vIdx] = (sa11Data[vIdx] + sa22Data[vIdx] + sa33Data[vIdx])/3.0f;
}
}
return dstDataFrames;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -372,6 +409,11 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult(in
return calculateTimeLapseResult(partIndex, resVarAddr);
}
if(resVarAddr.fieldName == "SM")
{
return calculateMeanStressSM(partIndex, resVarAddr);
}
if (resVarAddr.fieldName == "S-Bar")
{
return calculateBarConvertedResult(partIndex, resVarAddr, "S");

View File

@@ -73,6 +73,7 @@ private:
RigFemScalarResultFrames* calculateBarConvertedResult(int partIndex, const RigFemResultAddress &convertedResultAddr, const std::string fieldNameToConvert);
RigFemScalarResultFrames* calculateEnIpPorBarResult(int partIndex, const RigFemResultAddress &convertedResultAddr);
RigFemScalarResultFrames* calculateTimeLapseResult(int partIndex, const RigFemResultAddress& resVarAddr);
RigFemScalarResultFrames* calculateMeanStressSM(int partIndex, const RigFemResultAddress& resVarAddr);
cvf::Collection<RigFemPartResults> m_femPartResults;
cvf::ref<RifGeoMechReaderInterface> m_readerInterface;

View File

@@ -444,7 +444,7 @@ void RimGeoMechView::updateLegends()
legendTitle += ", " + cvfqt::Utils::toString(cellResult->resultComponentUiName());
}
if (cellResult->resultFieldName() == "SE" || cellResult->resultFieldName() == "ST" || cellResult->resultFieldName() == "POR-Bar")
if (cellResult->resultFieldName() == "SE" || cellResult->resultFieldName() == "ST" || cellResult->resultFieldName() == "POR-Bar" || cellResult->resultFieldName() == "SM")
{
legendTitle += " [Bar]";
}