mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#606) Made each node-result count only once
This commit is contained in:
@@ -61,8 +61,12 @@ private:
|
|||||||
{
|
{
|
||||||
RigFemPart* part = m_caseData->femParts()->part(pIdx);
|
RigFemPart* part = m_caseData->femParts()->part(pIdx);
|
||||||
const std::vector<float>& values = m_resultsData->resultValues(m_resVarAddr, pIdx, (int)timeStepIndex);
|
const std::vector<float>& values = m_resultsData->resultValues(m_resVarAddr, pIdx, (int)timeStepIndex);
|
||||||
int elmCount = part->elementCount();
|
|
||||||
|
|
||||||
|
size_t nodeCount = values.size();
|
||||||
|
cvf::UByteArray nodeVisibilities(nodeCount);
|
||||||
|
nodeVisibilities.setAll(false);
|
||||||
|
|
||||||
|
int elmCount = part->elementCount();
|
||||||
for (int elmIdx = 0; elmIdx < elmCount; ++elmIdx)
|
for (int elmIdx = 0; elmIdx < elmCount; ++elmIdx)
|
||||||
{
|
{
|
||||||
if (!(*m_cellVisibilities)[elmIdx]) continue;
|
if (!(*m_cellVisibilities)[elmIdx]) continue;
|
||||||
@@ -72,6 +76,14 @@ private:
|
|||||||
{
|
{
|
||||||
size_t elmNodeResIdx = part->elementNodeResultIdx(elmIdx, elmLocIdx);
|
size_t elmNodeResIdx = part->elementNodeResultIdx(elmIdx, elmLocIdx);
|
||||||
int nodeIdx = part->nodeIdxFromElementNodeResultIdx(elmNodeResIdx);
|
int nodeIdx = part->nodeIdxFromElementNodeResultIdx(elmNodeResIdx);
|
||||||
|
nodeVisibilities[nodeIdx] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (size_t nodeIdx = 0; nodeIdx < nodeCount; ++nodeIdx)
|
||||||
|
{
|
||||||
|
if (nodeVisibilities[nodeIdx])
|
||||||
|
{
|
||||||
accumulator.addValue(values[nodeIdx]);
|
accumulator.addValue(values[nodeIdx]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user