mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2715 Mohr Circle plot: Early exit if element type is not HEX8P
This commit is contained in:
parent
9856038524
commit
8383ee12cf
@ -341,18 +341,17 @@ void RiuMohrsCirclePlot::deleteEnvelopes()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuMohrsCirclePlot::queryData(RimGeoMechView* geoMechView,
|
void RiuMohrsCirclePlot::queryData(RimGeoMechView* geoMechView, size_t gridIndex, size_t elmIndex, const cvf::Color3ub& color)
|
||||||
size_t gridIndex,
|
|
||||||
size_t elmIndex,
|
|
||||||
const cvf::Color3ub& color)
|
|
||||||
{
|
{
|
||||||
CVF_ASSERT(geoMechView);
|
CVF_ASSERT(geoMechView);
|
||||||
m_sourceGeoMechViewOfLastPlot = geoMechView;
|
m_sourceGeoMechViewOfLastPlot = geoMechView;
|
||||||
|
|
||||||
RigFemPartResultsCollection* resultCollection = geoMechView->geoMechCase()->geoMechData()->femPartResults();
|
RigFemPart* femPart = geoMechView->geoMechCase()->geoMechData()->femParts()->part(gridIndex);
|
||||||
|
if (femPart->elementType(elmIndex) != HEX8P) return;
|
||||||
|
|
||||||
int frameIdx = geoMechView->currentTimeStep();
|
int frameIdx = geoMechView->currentTimeStep();
|
||||||
RigFemResultAddress address(RigFemResultPosEnum::RIG_ELEMENT_NODAL, "SE", "");
|
RigFemPartResultsCollection* resultCollection = geoMechView->geoMechCase()->geoMechData()->femPartResults();
|
||||||
|
RigFemResultAddress address(RigFemResultPosEnum::RIG_ELEMENT_NODAL, "SE", "");
|
||||||
|
|
||||||
// TODO: All tensors are calculated every time this function is called. FIX
|
// TODO: All tensors are calculated every time this function is called. FIX
|
||||||
std::vector<caf::Ten3f> vertexTensors = resultCollection->tensors(address, 0, frameIdx);
|
std::vector<caf::Ten3f> vertexTensors = resultCollection->tensors(address, 0, frameIdx);
|
||||||
@ -361,8 +360,6 @@ void RiuMohrsCirclePlot::queryData(RimGeoMechView* geoMechView,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RigFemPart* femPart = geoMechView->geoMechCase()->geoMechData()->femParts()->part(gridIndex);
|
|
||||||
|
|
||||||
// Calculate average tensor in element
|
// Calculate average tensor in element
|
||||||
caf::Ten3f tensorSumOfElmNodes = vertexTensors[femPart->elementNodeResultIdx((int)elmIndex, 0)];
|
caf::Ten3f tensorSumOfElmNodes = vertexTensors[femPart->elementNodeResultIdx((int)elmIndex, 0)];
|
||||||
for (int i = 1; i < 8; i++)
|
for (int i = 1; i < 8; i++)
|
||||||
@ -384,13 +381,14 @@ void RiuMohrsCirclePlot::queryData(RimGeoMechView* geoMechView,
|
|||||||
size_t i, j, k;
|
size_t i, j, k;
|
||||||
femPart->structGrid()->ijkFromCellIndex(elmIndex, &i, &j, &k);
|
femPart->structGrid()->ijkFromCellIndex(elmIndex, &i, &j, &k);
|
||||||
|
|
||||||
MohrsCirclesInfo mohrsCircle(principals, gridIndex, elmIndex, i, j, k, geoMechView, calculateFOS(principals, frictionAngleDeg, cohesion), color);
|
MohrsCirclesInfo mohrsCircle(
|
||||||
|
principals, gridIndex, elmIndex, i, j, k, geoMechView, calculateFOS(principals, frictionAngleDeg, cohesion), color);
|
||||||
|
|
||||||
addMohrsCirclesInfo(mohrsCircle);
|
addMohrsCirclesInfo(mohrsCircle);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuMohrsCirclePlot::updatePlot()
|
void RiuMohrsCirclePlot::updatePlot()
|
||||||
{
|
{
|
||||||
@ -578,7 +576,7 @@ void RiuMohrsCirclePlot::deletePlotItems()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuMohrsCirclePlot::scheduleUpdateAxisScale()
|
void RiuMohrsCirclePlot::scheduleUpdateAxisScale()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user