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 "RigCaseData.h"
#include "RigMainGrid.h"
#include "RigCaseCellResultsData.h" #include "RigCaseCellResultsData.h"
#include "RigResultAccessorFactory.h"
#include "RigFormationNames.h" #include "RigFormationNames.h"
#include "RigMainGrid.h"
#include "RigResultAccessorFactory.h"
#include <QDebug>
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
@@ -139,6 +142,25 @@ void RigCaseData::computeWellCellsPrGrid()
std::vector<RigGridBase*> grids; std::vector<RigGridBase*> grids;
this->allGrids(&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; size_t gIdx;
// Allocate and initialize the arrays // Allocate and initialize the arrays
@@ -169,6 +191,8 @@ void RigCaseData::computeWellCellsPrGrid()
{ {
RigWellResultFrame& wellCells = m_wellResults[wIdx]->m_wellCellsTimeSteps[tIdx]; RigWellResultFrame& wellCells = m_wellResults[wIdx]->m_wellCellsTimeSteps[tIdx];
// Well head
{
size_t gridIndex = wellCells.m_wellHead.m_gridIndex; size_t gridIndex = wellCells.m_wellHead.m_gridIndex;
size_t gridCellIndex = wellCells.m_wellHead.m_gridCellIndex; size_t gridCellIndex = wellCells.m_wellHead.m_gridCellIndex;
@@ -182,19 +206,23 @@ void RigCaseData::computeWellCellsPrGrid()
m_gridCellToResultWellIndex[gridIndex]->set(gridCellIndex, static_cast<cvf::uint>(wIdx)); m_gridCellToResultWellIndex[gridIndex]->set(gridCellIndex, static_cast<cvf::uint>(wIdx));
} }
} }
}
size_t sIdx; // Well result branches
for (sIdx = 0; sIdx < wellCells.m_wellResultBranches.size(); ++sIdx) for (size_t sIdx = 0; sIdx < wellCells.m_wellResultBranches.size(); ++sIdx)
{ {
RigWellResultBranch& wellSegment = wellCells.m_wellResultBranches[sIdx]; RigWellResultBranch& wellSegment = wellCells.m_wellResultBranches[sIdx];
size_t cdIdx; size_t cdIdx;
for (cdIdx = 0; cdIdx < wellSegment.m_branchResultPoints.size(); ++cdIdx) for (cdIdx = 0; cdIdx < wellSegment.m_branchResultPoints.size(); ++cdIdx)
{ {
gridIndex = wellSegment.m_branchResultPoints[cdIdx].m_gridIndex; size_t gridIndex = wellSegment.m_branchResultPoints[cdIdx].m_gridIndex;
gridCellIndex = wellSegment.m_branchResultPoints[cdIdx].m_gridCellIndex; size_t gridCellIndex = wellSegment.m_branchResultPoints[cdIdx].m_gridCellIndex;
if(gridIndex < m_wellCellsInGrid.size() && gridCellIndex < m_wellCellsInGrid[gridIndex]->size()) 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_wellCellsInGrid[gridIndex]->set(gridCellIndex, true);
m_gridCellToResultWellIndex[gridIndex]->set(gridCellIndex, static_cast<cvf::uint>(wIdx)); m_gridCellToResultWellIndex[gridIndex]->set(gridCellIndex, static_cast<cvf::uint>(wIdx));
} }