More Rename of globalCell to reservoirCell

This commit is contained in:
Jacob Støren
2014-08-14 10:56:25 +02:00
committed by Magne Sjaastad
parent 3022a40204
commit 09313c6caa
8 changed files with 44 additions and 44 deletions
@@ -553,16 +553,16 @@ bool RifReaderEclipseOutput::readActiveCellInfo()
std::vector<std::vector<int> > actnumValuesPerGrid; std::vector<std::vector<int> > actnumValuesPerGrid;
actnumValuesPerGrid.resize(actnumKeywordCount); actnumValuesPerGrid.resize(actnumKeywordCount);
size_t globalCellCount = 0; size_t reservoirCellCount = 0;
for (size_t gridIdx = 0; gridIdx < static_cast<size_t>(actnumKeywordCount); gridIdx++) for (size_t gridIdx = 0; gridIdx < static_cast<size_t>(actnumKeywordCount); gridIdx++)
{ {
RifEclipseOutputFileTools::keywordData(ecl_file, ACTNUM_KW, gridIdx, &actnumValuesPerGrid[gridIdx]); RifEclipseOutputFileTools::keywordData(ecl_file, ACTNUM_KW, gridIdx, &actnumValuesPerGrid[gridIdx]);
globalCellCount += actnumValuesPerGrid[gridIdx].size(); reservoirCellCount += actnumValuesPerGrid[gridIdx].size();
} }
// Check if number of cells is matching // Check if number of cells is matching
if (m_eclipseCase->mainGrid()->cells().size() != globalCellCount) if (m_eclipseCase->mainGrid()->cells().size() != reservoirCellCount)
{ {
return false; return false;
} }
@@ -570,8 +570,8 @@ bool RifReaderEclipseOutput::readActiveCellInfo()
RigActiveCellInfo* activeCellInfo = m_eclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS); RigActiveCellInfo* activeCellInfo = m_eclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS);
RigActiveCellInfo* fractureActiveCellInfo = m_eclipseCase->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS); RigActiveCellInfo* fractureActiveCellInfo = m_eclipseCase->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS);
activeCellInfo->setReservoirCellCount(globalCellCount); activeCellInfo->setReservoirCellCount(reservoirCellCount);
fractureActiveCellInfo->setReservoirCellCount(globalCellCount); fractureActiveCellInfo->setReservoirCellCount(reservoirCellCount);
activeCellInfo->setGridCount(actnumKeywordCount); activeCellInfo->setGridCount(actnumKeywordCount);
fractureActiveCellInfo->setGridCount(actnumKeywordCount); fractureActiveCellInfo->setGridCount(actnumKeywordCount);
@@ -352,7 +352,7 @@ void RimStatisticsCaseEvaluator::debugOutput(RimDefines::ResultCatType resultTyp
cvf::ref<cvf::StructGridScalarDataAccess> resultAccessor = m_destinationCase->resultAccessor(m_destinationCase->mainGrid(), RifReaderInterface::MATRIX_RESULTS, timeStepIdx, scalarResultIndex); cvf::ref<cvf::StructGridScalarDataAccess> resultAccessor = m_destinationCase->resultAccessor(m_destinationCase->mainGrid(), RifReaderInterface::MATRIX_RESULTS, timeStepIdx, scalarResultIndex);
if (resultAccessor.isNull()) return; if (resultAccessor.isNull()) return;
for (size_t cellIdx = 0; cellIdx < m_globalCellCount; cellIdx++) for (size_t cellIdx = 0; cellIdx < m_reservoirCellCount; cellIdx++)
{ {
qDebug() << resultAccessor->cellScalar(cellIdx); qDebug() << resultAccessor->cellScalar(cellIdx);
} }
@@ -365,12 +365,12 @@ RimStatisticsCaseEvaluator::RimStatisticsCaseEvaluator(const std::vector<RimCase
: m_sourceCases(sourceCases), : m_sourceCases(sourceCases),
m_statisticsConfig(statisticsConfig), m_statisticsConfig(statisticsConfig),
m_destinationCase(destinationCase), m_destinationCase(destinationCase),
m_globalCellCount(0), m_reservoirCellCount(0),
m_timeStepIndices(timeStepIndices) m_timeStepIndices(timeStepIndices)
{ {
if (sourceCases.size() > 0) if (sourceCases.size() > 0)
{ {
m_globalCellCount = sourceCases[0]->reservoirData()->mainGrid()->cells().size(); m_reservoirCellCount = sourceCases[0]->reservoirData()->mainGrid()->cells().size();
} }
CVF_ASSERT(m_destinationCase); CVF_ASSERT(m_destinationCase);
@@ -85,7 +85,7 @@ private:
std::vector<RimCase*> m_sourceCases; std::vector<RimCase*> m_sourceCases;
std::vector<size_t> m_timeStepIndices; std::vector<size_t> m_timeStepIndices;
size_t m_globalCellCount; size_t m_reservoirCellCount;
RimStatisticsConfig m_statisticsConfig; RimStatisticsConfig m_statisticsConfig;
RigCaseData* m_destinationCase; RigCaseData* m_destinationCase;
}; };
@@ -23,8 +23,8 @@
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RigActiveCellInfo::RigActiveCellInfo() RigActiveCellInfo::RigActiveCellInfo()
: m_globalActiveCellCount(0), : m_reservoirActiveCellCount(0),
m_globalCellResultCount(0), m_reservoirCellResultCount(0),
m_activeCellPositionMin(cvf::Vec3d::ZERO), m_activeCellPositionMin(cvf::Vec3d::ZERO),
m_activeCellPositionMax(cvf::Vec3d::ZERO) m_activeCellPositionMax(cvf::Vec3d::ZERO)
{ {
@@ -34,9 +34,9 @@ RigActiveCellInfo::RigActiveCellInfo()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RigActiveCellInfo::setReservoirCellCount(size_t globalCellCount) void RigActiveCellInfo::setReservoirCellCount(size_t reservoirCellCount)
{ {
m_cellIndexToResultIndex.resize(globalCellCount, cvf::UNDEFINED_SIZE_T); m_cellIndexToResultIndex.resize(reservoirCellCount, cvf::UNDEFINED_SIZE_T);
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -52,7 +52,7 @@ size_t RigActiveCellInfo::reservoirCellCount() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
size_t RigActiveCellInfo::reservoirCellResultCount() const size_t RigActiveCellInfo::reservoirCellResultCount() const
{ {
return m_globalCellResultCount; return m_reservoirCellResultCount;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -88,15 +88,15 @@ size_t RigActiveCellInfo::cellResultIndex(size_t reservoirCellIndex) const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RigActiveCellInfo::setCellResultIndex(size_t reservoirCellIndex, size_t globalCellResultIndex) void RigActiveCellInfo::setCellResultIndex(size_t reservoirCellIndex, size_t reservoirCellResultIndex)
{ {
CVF_TIGHT_ASSERT(globalCellResultIndex < m_cellIndexToResultIndex.size()); CVF_TIGHT_ASSERT(reservoirCellResultIndex < m_cellIndexToResultIndex.size());
m_cellIndexToResultIndex[reservoirCellIndex] = globalCellResultIndex; m_cellIndexToResultIndex[reservoirCellIndex] = reservoirCellResultIndex;
if (globalCellResultIndex >= m_globalCellResultCount) if (reservoirCellResultIndex >= m_reservoirCellResultCount)
{ {
m_globalCellResultCount = globalCellResultIndex + 1; m_reservoirCellResultCount = reservoirCellResultIndex + 1;
} }
} }
@@ -123,11 +123,11 @@ void RigActiveCellInfo::setGridActiveCellCounts(size_t gridIndex, size_t activeC
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RigActiveCellInfo::computeDerivedData() void RigActiveCellInfo::computeDerivedData()
{ {
m_globalActiveCellCount = 0; m_reservoirActiveCellCount = 0;
for (size_t i = 0; i < m_perGridActiveCellInfo.size(); i++) for (size_t i = 0; i < m_perGridActiveCellInfo.size(); i++)
{ {
m_globalActiveCellCount += m_perGridActiveCellInfo[i].activeCellCount(); m_reservoirActiveCellCount += m_perGridActiveCellInfo[i].activeCellCount();
} }
} }
@@ -136,7 +136,7 @@ void RigActiveCellInfo::computeDerivedData()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
size_t RigActiveCellInfo::reservoirActiveCellCount() const size_t RigActiveCellInfo::reservoirActiveCellCount() const
{ {
return m_globalActiveCellCount; return m_reservoirActiveCellCount;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -187,7 +187,7 @@ void RigActiveCellInfo::clear()
{ {
m_perGridActiveCellInfo.clear(); m_perGridActiveCellInfo.clear();
m_cellIndexToResultIndex.clear(); m_cellIndexToResultIndex.clear();
m_globalActiveCellCount = 0; m_reservoirActiveCellCount = 0;
m_activeCellPositionMin = cvf::Vec3st(0,0,0); m_activeCellPositionMin = cvf::Vec3st(0,0,0);
m_activeCellPositionMax = cvf::Vec3st(0,0,0); m_activeCellPositionMax = cvf::Vec3st(0,0,0);
m_activeCellsBoundingBox.reset(); m_activeCellsBoundingBox.reset();
@@ -198,7 +198,7 @@ void RigActiveCellInfo::clear()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RigActiveCellInfo::isCoarseningActive() const bool RigActiveCellInfo::isCoarseningActive() const
{ {
return m_globalCellResultCount != m_globalActiveCellCount; return m_reservoirCellResultCount != m_reservoirActiveCellCount;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -32,7 +32,7 @@ class RigActiveCellInfo : public cvf::Object
public: public:
RigActiveCellInfo(); RigActiveCellInfo();
void setReservoirCellCount(size_t globalCellCount); void setReservoirCellCount(size_t reservoirCellCount);
size_t reservoirCellCount() const; size_t reservoirCellCount() const;
size_t reservoirActiveCellCount() const; size_t reservoirActiveCellCount() const;
size_t reservoirCellResultCount() const; size_t reservoirCellResultCount() const;
@@ -72,8 +72,8 @@ private:
std::vector<size_t> m_cellIndexToResultIndex; std::vector<size_t> m_cellIndexToResultIndex;
size_t m_globalActiveCellCount; size_t m_reservoirActiveCellCount;
size_t m_globalCellResultCount; size_t m_reservoirCellResultCount;
cvf::Vec3st m_activeCellPositionMin; cvf::Vec3st m_activeCellPositionMin;
cvf::Vec3st m_activeCellPositionMax; cvf::Vec3st m_activeCellPositionMax;
@@ -38,12 +38,12 @@ public:
enum { NO_FAULT = -1, UNKNOWN_FAULT = -2 }; enum { NO_FAULT = -1, UNKNOWN_FAULT = -2 };
public: public:
RigFaultsPrCellAccumulator(size_t globalCellCount) RigFaultsPrCellAccumulator(size_t reservoirCellCount)
{ {
const int initVals[6] = { NO_FAULT, NO_FAULT, NO_FAULT, NO_FAULT, NO_FAULT, NO_FAULT}; const int initVals[6] = { NO_FAULT, NO_FAULT, NO_FAULT, NO_FAULT, NO_FAULT, NO_FAULT};
caf::IntArray6 initVal; caf::IntArray6 initVal;
initVal = initVals; initVal = initVals;
m_faultIdxForCellFace.resize(globalCellCount, initVal); m_faultIdxForCellFace.resize(reservoirCellCount, initVal);
} }
inline int faultIdx(size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face) inline int faultIdx(size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face)
@@ -95,7 +95,7 @@ public:
const std::vector<size_t>& connectionIndices() const { return m_connectionIndices; } const std::vector<size_t>& connectionIndices() const { return m_connectionIndices; }
static RigFaultsPrCellAccumulator* faultsPrCellAccumulator() { CVF_ASSERT(m_faultsPrCellAcc.notNull()); return m_faultsPrCellAcc.p();} static RigFaultsPrCellAccumulator* faultsPrCellAccumulator() { CVF_ASSERT(m_faultsPrCellAcc.notNull()); return m_faultsPrCellAcc.p();}
static void initFaultsPrCellAccumulator(size_t globalCellCount) { m_faultsPrCellAcc = new RigFaultsPrCellAccumulator(globalCellCount); } static void initFaultsPrCellAccumulator(size_t reservoirCellCount) { m_faultsPrCellAcc = new RigFaultsPrCellAccumulator(reservoirCellCount); }
private: private:
QString m_name; QString m_name;
@@ -170,7 +170,7 @@ public:
hostCellK.reserve(numMatrixModelActiveCells); hostCellK.reserve(numMatrixModelActiveCells);
globalCoarseningBoxIdx.reserve(numMatrixModelActiveCells); globalCoarseningBoxIdx.reserve(numMatrixModelActiveCells);
const std::vector<RigCell>& globalCells = reservoirCase->reservoirData()->mainGrid()->cells(); const std::vector<RigCell>& reservoirCells = reservoirCase->reservoirData()->mainGrid()->cells();
std::vector<size_t> globalCoarseningBoxIndexStart; std::vector<size_t> globalCoarseningBoxIndexStart;
@@ -190,13 +190,13 @@ public:
} }
for (size_t cIdx = 0; cIdx < globalCells.size(); ++cIdx) for (size_t cIdx = 0; cIdx < reservoirCells.size(); ++cIdx)
{ {
if (actCellInfo->isActive(cIdx)) if (actCellInfo->isActive(cIdx))
{ {
RigGridBase* grid = globalCells[cIdx].hostGrid(); RigGridBase* grid = reservoirCells[cIdx].hostGrid();
CVF_ASSERT(grid != NULL); CVF_ASSERT(grid != NULL);
size_t cellIndex = globalCells[cIdx].cellIndex(); size_t cellIndex = reservoirCells[cIdx].cellIndex();
size_t i, j, k; size_t i, j, k;
grid->ijkFromCellIndex(cellIndex, &i, &j, &k); grid->ijkFromCellIndex(cellIndex, &i, &j, &k);
@@ -213,7 +213,7 @@ public:
} }
else else
{ {
size_t parentCellIdx = globalCells[cIdx].parentCellIndex(); size_t parentCellIdx = reservoirCells[cIdx].parentCellIndex();
parentGrid = (static_cast<RigLocalGrid*>(grid))->parentGrid(); parentGrid = (static_cast<RigLocalGrid*>(grid))->parentGrid();
CVF_ASSERT(parentGrid != NULL); CVF_ASSERT(parentGrid != NULL);
parentGrid->ijkFromCellIndex(parentCellIdx, &pi, &pj, &pk); parentGrid->ijkFromCellIndex(parentCellIdx, &pi, &pj, &pk);
@@ -229,7 +229,7 @@ public:
hostCellJ.push_back(static_cast<qint32>(pj + 1)); // NB: 1-based index in Octave hostCellJ.push_back(static_cast<qint32>(pj + 1)); // NB: 1-based index in Octave
hostCellK.push_back(static_cast<qint32>(pk + 1)); // NB: 1-based index in Octave hostCellK.push_back(static_cast<qint32>(pk + 1)); // NB: 1-based index in Octave
size_t coarseningIdx = globalCells[cIdx].coarseningBoxIndex(); size_t coarseningIdx = reservoirCells[cIdx].coarseningBoxIndex();
if (coarseningIdx != cvf::UNDEFINED_SIZE_T) if (coarseningIdx != cvf::UNDEFINED_SIZE_T)
{ {
size_t globalCoarseningIdx = globalCoarseningBoxIndexStart[grid->gridIndex()] + coarseningIdx; size_t globalCoarseningIdx = globalCoarseningBoxIndexStart[grid->gridIndex()] + coarseningIdx;
@@ -148,11 +148,11 @@ public:
std::vector<double> values(valueCount); std::vector<double> values(valueCount);
size_t valueIndex = 0; size_t valueIndex = 0;
size_t globalCellCount = activeInfo->reservoirCellCount(); size_t reservoirCellCount = activeInfo->reservoirCellCount();
for (size_t tIdx = 0; tIdx < requestedTimesteps.size(); ++tIdx) for (size_t tIdx = 0; tIdx < requestedTimesteps.size(); ++tIdx)
{ {
std::vector<double>& doubleValues = scalarResultFrames->at(requestedTimesteps[tIdx]); std::vector<double>& doubleValues = scalarResultFrames->at(requestedTimesteps[tIdx]);
for (size_t gcIdx = 0; gcIdx < globalCellCount; ++gcIdx) for (size_t gcIdx = 0; gcIdx < reservoirCellCount; ++gcIdx)
{ {
size_t resultIdx = activeInfo->cellResultIndex(gcIdx); size_t resultIdx = activeInfo->cellResultIndex(gcIdx);
if (resultIdx == cvf::UNDEFINED_SIZE_T) continue; if (resultIdx == cvf::UNDEFINED_SIZE_T) continue;
@@ -528,18 +528,18 @@ public:
RigActiveCellInfo* activeCellInfo = m_currentReservoir->reservoirData()->activeCellInfo(m_porosityModelEnum); RigActiveCellInfo* activeCellInfo = m_currentReservoir->reservoirData()->activeCellInfo(m_porosityModelEnum);
size_t globalActiveCellCount = activeCellInfo->reservoirActiveCellCount(); size_t activeCellCountReservoir = activeCellInfo->reservoirActiveCellCount();
size_t totalCellCount = activeCellInfo->reservoirCellCount(); size_t totalCellCount = activeCellInfo->reservoirCellCount();
size_t globalCellResultCount = activeCellInfo->reservoirCellResultCount(); size_t reservoirCellResultCount = activeCellInfo->reservoirCellResultCount();
bool isCoarseningActive = globalCellResultCount != globalActiveCellCount; bool isCoarseningActive = reservoirCellResultCount != activeCellCountReservoir;
if (cellCountFromOctave != globalActiveCellCount ) if (cellCountFromOctave != activeCellCountReservoir )
{ {
server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") +
RiaSocketServer::tr("The number of cells in the data coming from octave does not match the case") + ":\"" + m_currentReservoir->caseUserDescription() + "\"\n" RiaSocketServer::tr("The number of cells in the data coming from octave does not match the case") + ":\"" + m_currentReservoir->caseUserDescription() + "\"\n"
" Octave: " + QString::number(cellCountFromOctave) + "\n" " Octave: " + QString::number(cellCountFromOctave) + "\n"
" " + m_currentReservoir->caseUserDescription() + ": Active cell count: " + QString::number(globalActiveCellCount) + " Total cell count: " + QString::number(totalCellCount)) ; " " + m_currentReservoir->caseUserDescription() + ": Active cell count: " + QString::number(activeCellCountReservoir) + " Total cell count: " + QString::number(totalCellCount)) ;
cellCountFromOctave = 0; cellCountFromOctave = 0;
m_invalidActiveCellCountDetected = true; m_invalidActiveCellCountDetected = true;
@@ -554,7 +554,7 @@ public:
for (size_t tIdx = 0; tIdx < m_timeStepCountToRead; ++tIdx) for (size_t tIdx = 0; tIdx < m_timeStepCountToRead; ++tIdx)
{ {
size_t tsId = m_requestedTimesteps[tIdx]; size_t tsId = m_requestedTimesteps[tIdx];
m_scalarResultsToAdd->at(tsId).resize(globalCellResultCount, HUGE_VAL); m_scalarResultsToAdd->at(tsId).resize(reservoirCellResultCount, HUGE_VAL);
} }
std::vector<double> readBuffer; std::vector<double> readBuffer;