mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2522 Mohr circle: Avoid calculating circle if result without tensor is selected
This commit is contained in:
parent
1706a6c0c4
commit
fe301bfc11
@ -126,6 +126,7 @@ void RiuMohrsCirclePlot::updateOnSelectionChanged(const RiuSelectionItem* select
|
|||||||
void RiuMohrsCirclePlot::clearPlot()
|
void RiuMohrsCirclePlot::clearPlot()
|
||||||
{
|
{
|
||||||
deleteCircles();
|
deleteCircles();
|
||||||
|
this->replot();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -180,7 +181,7 @@ void RiuMohrsCirclePlot::redrawCircles()
|
|||||||
|
|
||||||
// Ex 1: xMin will be set to 1.1 * m_principal3 to be able to see the whole circle
|
// Ex 1: xMin will be set to 1.1 * m_principal3 to be able to see the whole circle
|
||||||
// |y
|
// |y
|
||||||
// _|____
|
// _|_____
|
||||||
// / | \
|
// / | \
|
||||||
// / | \
|
// / | \
|
||||||
//--|---|-------|------- x
|
//--|---|-------|------- x
|
||||||
@ -245,10 +246,20 @@ void RiuMohrsCirclePlot::queryDataAndUpdatePlot(RimGeoMechView* geoMechView, siz
|
|||||||
int frameIdx = geoMechView->currentTimeStep();
|
int frameIdx = geoMechView->currentTimeStep();
|
||||||
|
|
||||||
RigFemResultAddress currentAddress = geoMechView->cellResult->resultAddress();
|
RigFemResultAddress currentAddress = geoMechView->cellResult->resultAddress();
|
||||||
|
if (!(currentAddress.fieldName == "SE" || currentAddress.fieldName == "ST" || currentAddress.fieldName == "E"))
|
||||||
// TODO: All tensors are calculated everytime this function is called. FIX
|
{
|
||||||
|
clearPlot();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// TODO: All tensors are calculated every time this function is called. FIX
|
||||||
std::vector<caf::Ten3f> vertexTensors = resultCollection->tensors(currentAddress, 0, frameIdx);
|
std::vector<caf::Ten3f> vertexTensors = resultCollection->tensors(currentAddress, 0, frameIdx);
|
||||||
RigFemPart* femPart = geoMechView->geoMechCase()->geoMechData()->femParts()->part(gridIndex);
|
if (vertexTensors.empty())
|
||||||
|
{
|
||||||
|
clearPlot();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
RigFemPart* femPart = geoMechView->geoMechCase()->geoMechData()->femParts()->part(gridIndex);
|
||||||
|
|
||||||
caf::Ten3f tensorSumOfElmNodes = vertexTensors[femPart->elementNodeResultIdx((int)cellIndex, 0)];
|
caf::Ten3f tensorSumOfElmNodes = vertexTensors[femPart->elementNodeResultIdx((int)cellIndex, 0)];
|
||||||
for (int i = 1; i < 8; i++)
|
for (int i = 1; i < 8; i++)
|
||||||
|
Loading…
Reference in New Issue
Block a user