From 422a682b2731be3d7336a54dcdca16eb85bcf257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Wed, 17 Jun 2015 14:22:14 +0200 Subject: [PATCH] Added the missing ST-components, Added calculation of principal ST, Used POR = 0 when undefined in calculation of ST #320, #319 --- .../RigFemPartResultsCollection.cpp | 53 ++++++++++++++----- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp index 145f120369..027493e699 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp @@ -165,6 +165,12 @@ std::map > RigFemPartResultsCollection::sc fieldCompNames["ST"].push_back("S11"); fieldCompNames["ST"].push_back("S22"); fieldCompNames["ST"].push_back("S33"); + fieldCompNames["ST"].push_back("S12"); + fieldCompNames["ST"].push_back("S13"); + fieldCompNames["ST"].push_back("S23"); + fieldCompNames["ST"].push_back("S1"); + fieldCompNames["ST"].push_back("S2"); + fieldCompNames["ST"].push_back("S3"); } else if (resPos == RIG_INTEGRATION_POINT) { @@ -182,6 +188,12 @@ std::map > RigFemPartResultsCollection::sc fieldCompNames["ST"].push_back("S11"); fieldCompNames["ST"].push_back("S22"); fieldCompNames["ST"].push_back("S33"); + fieldCompNames["ST"].push_back("S12"); + fieldCompNames["ST"].push_back("S13"); + fieldCompNames["ST"].push_back("S23"); + fieldCompNames["ST"].push_back("S1"); + fieldCompNames["ST"].push_back("S2"); + fieldCompNames["ST"].push_back("S3"); } } @@ -214,18 +226,19 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult(in return dstDataFrames; } - if (resVarAddr.fieldName == "NS" && (resVarAddr.componentName == "S1" || resVarAddr.componentName == "S2" || resVarAddr.componentName == "S3" )) + if ( (resVarAddr.fieldName == "NS" || resVarAddr.fieldName == "ST" ) + && (resVarAddr.componentName == "S1" || resVarAddr.componentName == "S2" || resVarAddr.componentName == "S3" )) { - RigFemScalarResultFrames * ns11Frames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "NS", "S11")); - RigFemScalarResultFrames * ns22Frames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "NS", "S22")); - RigFemScalarResultFrames * ns33Frames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "NS", "S33")); - RigFemScalarResultFrames * ns12Frames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "NS", "S12")); - RigFemScalarResultFrames * ns13Frames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "NS", "S13")); - RigFemScalarResultFrames * ns23Frames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "NS", "S23")); + RigFemScalarResultFrames * ns11Frames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, resVarAddr.fieldName, "S11")); + RigFemScalarResultFrames * ns22Frames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, resVarAddr.fieldName, "S22")); + RigFemScalarResultFrames * ns33Frames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, resVarAddr.fieldName, "S33")); + RigFemScalarResultFrames * ns12Frames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, resVarAddr.fieldName, "S12")); + RigFemScalarResultFrames * ns13Frames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, resVarAddr.fieldName, "S13")); + RigFemScalarResultFrames * ns23Frames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, resVarAddr.fieldName, "S23")); - RigFemScalarResultFrames * ns1Frames = m_femPartResults[partIndex]->createScalarResult(RigFemResultAddress(resVarAddr.resultPosType, "NS", "S1")); - RigFemScalarResultFrames * ns2Frames = m_femPartResults[partIndex]->createScalarResult(RigFemResultAddress(resVarAddr.resultPosType, "NS", "S2")); - RigFemScalarResultFrames * ns3Frames = m_femPartResults[partIndex]->createScalarResult(RigFemResultAddress(resVarAddr.resultPosType, "NS", "S3")); + RigFemScalarResultFrames * ns1Frames = m_femPartResults[partIndex]->createScalarResult(RigFemResultAddress(resVarAddr.resultPosType, resVarAddr.fieldName, "S1")); + RigFemScalarResultFrames * ns2Frames = m_femPartResults[partIndex]->createScalarResult(RigFemResultAddress(resVarAddr.resultPosType, resVarAddr.fieldName, "S2")); + RigFemScalarResultFrames * ns3Frames = m_femPartResults[partIndex]->createScalarResult(RigFemResultAddress(resVarAddr.resultPosType, resVarAddr.fieldName, "S3")); int frameCount = ns11Frames->frameCount(); for (int fIdx = 0; fIdx < frameCount; ++fIdx) @@ -263,7 +276,7 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult(in return requestedPrincipal; } - if ( resVarAddr.fieldName == "ST" + if ( resVarAddr.fieldName == "ST" && ( resVarAddr.componentName == "S11" || resVarAddr.componentName == "S22" || resVarAddr.componentName == "S33" )) @@ -287,12 +300,28 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult(in for (size_t vIdx = 0; vIdx < valCount; ++vIdx) { nodeIdx = femPart->nodeIdxFromElementNodeResultIdx(vIdx); - dstFrameData[vIdx] = srcNSFrameData[vIdx] + srcPORFrameData[nodeIdx]; + float por = srcPORFrameData[nodeIdx]; + if (por == std::numeric_limits::infinity()) por = 0.0f; + dstFrameData[vIdx] = srcNSFrameData[vIdx] + por; } } return dstDataFrames; } + if ( resVarAddr.fieldName == "ST" + && ( resVarAddr.componentName == "S12" + || resVarAddr.componentName == "S13" + || resVarAddr.componentName == "S23" )) + { + return this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "NS", resVarAddr.componentName)); + } + + if (resVarAddr.fieldName == "ST" && resVarAddr.componentName == "") + { + // Create and return an empty result + return m_femPartResults[partIndex]->createScalarResult(resVarAddr); + } + return NULL; }