diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemNativeVisibleCellsStatCalc.h b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemNativeVisibleCellsStatCalc.h index bcc7c05df9..8653d2a7be 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemNativeVisibleCellsStatCalc.h +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemNativeVisibleCellsStatCalc.h @@ -93,6 +93,22 @@ private: } } } + else if (m_resVarAddr.resultPosType == RIG_ELEMENT) + { + for (int pIdx = 0; pIdx < partCount; ++pIdx) + { + RigFemPart* part = m_caseData->femParts()->part(pIdx); + const std::vector& values = m_resultsData->resultValues(m_resVarAddr, pIdx, (int)timeStepIndex); + int elmCount = part->elementCount(); + + for (int elmIdx = 0; elmIdx < elmCount; ++elmIdx) + { + if (!(*m_cellVisibilities)[elmIdx]) continue; + + accumulator.addValue(values[elmIdx]); + } + } + } else { for (int pIdx = 0; pIdx < partCount; ++pIdx)