Added debug output of grid name and size, added comments

This commit is contained in:
Magne Sjaastad 2016-09-09 11:03:57 +02:00
parent 39d82a28f4
commit 2f5acc38ac

View File

@ -19,10 +19,13 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RigCaseData.h"
#include "RigMainGrid.h"
#include "RigCaseCellResultsData.h"
#include "RigResultAccessorFactory.h"
#include "RigFormationNames.h"
#include "RigMainGrid.h"
#include "RigResultAccessorFactory.h"
#include <QDebug>
//--------------------------------------------------------------------------------------------------
///
@ -139,6 +142,25 @@ void RigCaseData::computeWellCellsPrGrid()
std::vector<RigGridBase*> grids;
this->allGrids(&grids);
// Debug code used to display grid names and grid sizes
/*
size_t totCellCount = 0;
for (auto g : grids)
{
qDebug() << g->gridName().data();
qDebug() << g->cellCountI() << " " << g->cellCountJ() << " " << g->cellCountK() << " ";
size_t cellCount = g->cellCount();
totCellCount += cellCount;
qDebug() << cellCount;
qDebug() << "\n";
}
qDebug() << "\nTotal cell count " << totCellCount;
*/
size_t gIdx;
// Allocate and initialize the arrays
@ -169,32 +191,38 @@ void RigCaseData::computeWellCellsPrGrid()
{
RigWellResultFrame& wellCells = m_wellResults[wIdx]->m_wellCellsTimeSteps[tIdx];
size_t gridIndex = wellCells.m_wellHead.m_gridIndex;
size_t gridCellIndex = wellCells.m_wellHead.m_gridCellIndex;
if (gridIndex < m_wellCellsInGrid.size() && gridCellIndex < m_wellCellsInGrid[gridIndex]->size())
// Well head
{
size_t reservoirCellIndex = grids[gridIndex]->reservoirCellIndex(gridCellIndex);
if (m_activeCellInfo->isActive(reservoirCellIndex)
|| m_fractureActiveCellInfo->isActive(reservoirCellIndex))
size_t gridIndex = wellCells.m_wellHead.m_gridIndex;
size_t gridCellIndex = wellCells.m_wellHead.m_gridCellIndex;
if (gridIndex < m_wellCellsInGrid.size() && gridCellIndex < m_wellCellsInGrid[gridIndex]->size())
{
m_wellCellsInGrid[gridIndex]->set(gridCellIndex, true);
m_gridCellToResultWellIndex[gridIndex]->set(gridCellIndex, static_cast<cvf::uint>(wIdx));
size_t reservoirCellIndex = grids[gridIndex]->reservoirCellIndex(gridCellIndex);
if (m_activeCellInfo->isActive(reservoirCellIndex)
|| m_fractureActiveCellInfo->isActive(reservoirCellIndex))
{
m_wellCellsInGrid[gridIndex]->set(gridCellIndex, true);
m_gridCellToResultWellIndex[gridIndex]->set(gridCellIndex, static_cast<cvf::uint>(wIdx));
}
}
}
size_t sIdx;
for (sIdx = 0; sIdx < wellCells.m_wellResultBranches.size(); ++sIdx)
// Well result branches
for (size_t sIdx = 0; sIdx < wellCells.m_wellResultBranches.size(); ++sIdx)
{
RigWellResultBranch& wellSegment = wellCells.m_wellResultBranches[sIdx];
size_t cdIdx;
for (cdIdx = 0; cdIdx < wellSegment.m_branchResultPoints.size(); ++cdIdx)
{
gridIndex = wellSegment.m_branchResultPoints[cdIdx].m_gridIndex;
gridCellIndex = wellSegment.m_branchResultPoints[cdIdx].m_gridCellIndex;
size_t gridIndex = wellSegment.m_branchResultPoints[cdIdx].m_gridIndex;
size_t gridCellIndex = wellSegment.m_branchResultPoints[cdIdx].m_gridCellIndex;
if(gridIndex < m_wellCellsInGrid.size() && gridCellIndex < m_wellCellsInGrid[gridIndex]->size())
{
// NOTE : We do not check if the grid cell is active as we do for well head.
// If we add test for active cell, thorough testing and verification of the new behaviour must be adressed
m_wellCellsInGrid[gridIndex]->set(gridCellIndex, true);
m_gridCellToResultWellIndex[gridIndex]->set(gridCellIndex, static_cast<cvf::uint>(wIdx));
}