mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added a "NS" field result variable
#318 Geomechanical sign on stress components The NS name can be changed in the GUI, but we need to distinguish S from NS in the reader/calculation system
This commit is contained in:
parent
b99b334fc8
commit
e10bc01532
@ -78,10 +78,22 @@ std::map<std::string, std::vector<std::string> > RigFemPartResultsCollection::sc
|
|||||||
else if (resPos == RIG_ELEMENT_NODAL)
|
else if (resPos == RIG_ELEMENT_NODAL)
|
||||||
{
|
{
|
||||||
fieldCompNames = m_readerInterface->scalarElementNodeFieldAndComponentNames();
|
fieldCompNames = m_readerInterface->scalarElementNodeFieldAndComponentNames();
|
||||||
|
fieldCompNames["NS"].push_back("S11");
|
||||||
|
fieldCompNames["NS"].push_back("S22");
|
||||||
|
fieldCompNames["NS"].push_back("S33");
|
||||||
|
fieldCompNames["NS"].push_back("S12");
|
||||||
|
fieldCompNames["NS"].push_back("S13");
|
||||||
|
fieldCompNames["NS"].push_back("S23");
|
||||||
}
|
}
|
||||||
else if (resPos == RIG_INTEGRATION_POINT)
|
else if (resPos == RIG_INTEGRATION_POINT)
|
||||||
{
|
{
|
||||||
fieldCompNames = m_readerInterface->scalarIntegrationPointFieldAndComponentNames();
|
fieldCompNames = m_readerInterface->scalarIntegrationPointFieldAndComponentNames();
|
||||||
|
fieldCompNames["NS"].push_back("S11");
|
||||||
|
fieldCompNames["NS"].push_back("S22");
|
||||||
|
fieldCompNames["NS"].push_back("S33");
|
||||||
|
fieldCompNames["NS"].push_back("S12");
|
||||||
|
fieldCompNames["NS"].push_back("S13");
|
||||||
|
fieldCompNames["NS"].push_back("S23");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,8 +179,23 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult(in
|
|||||||
|
|
||||||
if (resVarAddr.fieldName == "NS")
|
if (resVarAddr.fieldName == "NS")
|
||||||
{
|
{
|
||||||
|
RigFemScalarResultFrames * srcDataFrames = this->findOrLoadScalarResult(partIndex, RigFemResultAddress(resVarAddr.resultPosType, "S", resVarAddr.componentName));
|
||||||
|
RigFemScalarResultFrames * dstDataFrames = m_femPartResults[partIndex]->createScalarResult(resVarAddr);
|
||||||
|
int frameCount = srcDataFrames->frameCount();
|
||||||
|
for (int fIdx = 0; fIdx < frameCount; ++fIdx)
|
||||||
|
{
|
||||||
|
const std::vector<float>& srcFrameData = srcDataFrames->frameData(fIdx);
|
||||||
|
std::vector<float>& dstFrameData = dstDataFrames->frameData(fIdx);
|
||||||
|
size_t valCount = srcFrameData.size();
|
||||||
|
dstFrameData.resize(valCount);
|
||||||
|
for (size_t vIdx = 0; vIdx < valCount; ++vIdx)
|
||||||
|
{
|
||||||
|
dstFrameData[vIdx] = -srcFrameData[vIdx];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return dstDataFrames;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user