MswRollUp: Added some guarding to get the Troll_MSW case through. Needs some assert disabling in RigGridBase as well, but it is not included yet

This is an intermediate commit and does not compile
p4#: 22218
This commit is contained in:
Jacob Støren 2013-08-26 14:21:21 +02:00
parent 544d98b37e
commit 42408eda74
2 changed files with 40 additions and 24 deletions

View File

@ -1004,6 +1004,8 @@ void RifReaderEclipseOutput::readWellCells(const ecl_grid_type* mainEclGrid)
}
}
if (outletErtBranchIndex != cvf::UNDEFINED_SIZE_T) // Todo: Is this a correct guarding ? Or is it indicating an error ?
{
RigWellResultBranch& outletResultBranch = wellResFrame.m_wellResultBranches[currentGridBranchStartIndex + outletErtBranchIndex];
int outletErtSegmentId = well_segment_get_branch_id(outletBranchSegment);
@ -1020,7 +1022,8 @@ void RifReaderEclipseOutput::readWellCells(const ecl_grid_type* mainEclGrid)
if (lastCellIndexForSegmentIdInOutletBranch == cvf::UNDEFINED_SIZE_T)
{
// Did not find the cell in the outlet branch based on branch id and segment id from outlet cell in leaf branch
CVF_ASSERT(0);
//std::cout << "Did not find the cell in the outlet branch based on branch id and segment id from outlet cell in leaf branch" << std::endl;
//CVF_ASSERT(0);
}
else
{
@ -1030,6 +1033,7 @@ void RifReaderEclipseOutput::readWellCells(const ecl_grid_type* mainEclGrid)
wellResultLeafBranch.m_outletBranchHeadCellIndex_OBSOLETE = lastCellIndexForSegmentIdInOutletBranch;
}
}
}
// Update outlet well cells with no grid cell connections
@ -1122,9 +1126,10 @@ void RifReaderEclipseOutput::readWellCells(const ecl_grid_type* mainEclGrid)
size_t outCellIdx = wellResFrame.m_wellResultBranches[bIdx].m_outletBranchHeadCellIndex_OBSOLETE;
const RigWellResultPoint* resPoint = wellResFrame.findResultCellFromOutletSpecification(outBranchIdx, outCellIdx);
if (resPoint) // Todo: Is this a correct guarding or indicating an error ?
{
wellResFrame.m_wellResultBranches[bIdx].m_branchResultPoints.insert(wellResFrame.m_wellResultBranches[bIdx].m_branchResultPoints.begin(), *resPoint);
}
}
}

View File

@ -252,8 +252,19 @@ void RivWellPipesPartMgr::calculateWellPipeCenterline( std::vector< std::vector
for (size_t brIdx = 0; brIdx < resBranches.size(); brIdx++)
{
if (resBranches[brIdx].m_branchResultPoints.size() == 0)
continue; // Skip empty branches. Do not know why they exist, but they make problems.
// Skip empty branches. Do not know why they exist, but they make problems.
bool hasValidData = false;
for (size_t cIdx = 0; cIdx < resBranches[brIdx].m_branchResultPoints.size(); ++cIdx)
{
if (resBranches[brIdx].m_branchResultPoints[cIdx].isValid())
{
hasValidData = true;
break;
}
}
if (!hasValidData) continue;
prevWellResPoint = NULL;