mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#563) Added integration point number in result info text for Geom Cases.
Also added node coordinates of associated nodes.
This commit is contained in:
parent
f7ebf80e0d
commit
765c659c7f
@ -99,3 +99,28 @@ int RigFemTypes::oppositeFace(RigElementType elmType, int faceIdx)
|
||||
|
||||
return faceIdx;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
const int* RigFemTypes::localElmNodeToIntegrationPointMapping(RigElementType elmType)
|
||||
{
|
||||
static const int HEX8_Mapping[8] ={ 0, 1, 3, 2, 4, 5, 7, 6 };
|
||||
|
||||
switch (elmType)
|
||||
{
|
||||
case HEX8:
|
||||
case HEX8P:
|
||||
return HEX8_Mapping;
|
||||
break;
|
||||
case CAX4:
|
||||
return HEX8_Mapping; // First four is identical to HEX8
|
||||
break;
|
||||
default:
|
||||
assert(false); // Element type not supported
|
||||
break;
|
||||
}
|
||||
|
||||
return HEX8_Mapping;
|
||||
}
|
||||
|
@ -35,4 +35,5 @@ public:
|
||||
static int elmentFaceCount(RigElementType elmType);
|
||||
static const int* localElmNodeIndicesForFace(RigElementType elmType, int faceIdx, int* faceNodeCount);
|
||||
static int oppositeFace(RigElementType elmType, int faceIdx);
|
||||
static const int* localElmNodeToIntegrationPointMapping(RigElementType elmType);
|
||||
};
|
||||
|
@ -924,7 +924,7 @@ void RifOdbReader::readIntegrationPointField(const std::string& fieldName, int p
|
||||
float* data = bulkDataGetter.data();
|
||||
|
||||
RigElementType eType = toRigElementType(bulkData.baseElementType());
|
||||
const int* elmNodeToIpResultMapping = localElmNodeToIntegrationPointMapping(eType);
|
||||
const int* elmNodeToIpResultMapping = localElmNodeToIntegrationPointMapping(eType); // Todo: Use the one in RigFemTypes.h, but we need to guard against unknown element types first.
|
||||
if (!elmNodeToIpResultMapping) continue;
|
||||
|
||||
for (int elem = 0; elem < elemCount; elem++)
|
||||
|
@ -178,6 +178,8 @@ void RiuFemResultTextBuilder::appendTextFromResultColors(RigGeoMechCaseData* geo
|
||||
RigElementType elmType = femPart->elementType(cellIndex);
|
||||
const int* elmentConn = femPart->connectivities(cellIndex);
|
||||
int elmNodeCount = RigFemTypes::elmentNodeCount(elmType);
|
||||
const int* lElmNodeToIpMap = RigFemTypes::localElmNodeToIntegrationPointMapping(elmType);
|
||||
|
||||
for (int lNodeIdx = 0; lNodeIdx < elmNodeCount; ++lNodeIdx)
|
||||
{
|
||||
|
||||
@ -194,7 +196,18 @@ void RiuFemResultTextBuilder::appendTextFromResultColors(RigGeoMechCaseData* geo
|
||||
scalarValue = scalarResults[resIdx];
|
||||
}
|
||||
|
||||
resultInfoText->append(QString("\tN:%1 \t: %2\n").arg(femPart->nodes().nodeIds[nodeIdx]).arg(scalarValue));
|
||||
|
||||
if (resultColors->resultPositionType() == RIG_INTEGRATION_POINT)
|
||||
{
|
||||
resultInfoText->append(QString("\tIP:%1 \t: %2 \tAss. Node: \t%3").arg(lElmNodeToIpMap[lNodeIdx] + 1 ).arg(scalarValue).arg(femPart->nodes().nodeIds[nodeIdx]));
|
||||
}
|
||||
else
|
||||
{
|
||||
resultInfoText->append(QString("\tN:%1 \t: %2").arg(femPart->nodes().nodeIds[nodeIdx]).arg(scalarValue));
|
||||
}
|
||||
|
||||
cvf::Vec3f nodeCoord = femPart->nodes().coordinates[nodeIdx];
|
||||
resultInfoText->append(QString("\t( %3, %4, %5)\n").arg(nodeCoord[0]).arg(nodeCoord[1]).arg(nodeCoord[2]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user