mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Replaced dataAccessObject with resultAccessor
This commit is contained in:
parent
824ea81b99
commit
322823754b
@ -500,8 +500,8 @@ bool RifEclipseInputFileTools::writeBinaryResultToTextFile(const QString& fileNa
|
||||
return false;
|
||||
}
|
||||
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObject = eclipseCase->dataAccessObject(eclipseCase->mainGrid(), porosityModel, timeStep, resultIndex);
|
||||
if (dataAccessObject.isNull())
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> resultAccessor = eclipseCase->resultAccessor(eclipseCase->mainGrid(), porosityModel, timeStep, resultIndex);
|
||||
if (resultAccessor.isNull())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -514,7 +514,7 @@ bool RifEclipseInputFileTools::writeBinaryResultToTextFile(const QString& fileNa
|
||||
{
|
||||
for (i = 0; i < eclipseCase->mainGrid()->cellCountI(); i++)
|
||||
{
|
||||
double resultValue = dataAccessObject->cellScalar(eclipseCase->mainGrid()->cellIndexFromIJK(i, j, k));
|
||||
double resultValue = resultAccessor->cellScalar(eclipseCase->mainGrid()->cellIndexFromIJK(i, j, k));
|
||||
if (resultValue == HUGE_VAL)
|
||||
{
|
||||
resultValue = undefinedValue;
|
||||
|
@ -121,7 +121,7 @@ void RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo(
|
||||
}
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultSlot->porosityModel());
|
||||
cellCenterDataAccessObject = eclipseCase->dataAccessObject(grid, porosityModel, timeStepIndex, cellResultSlot->gridScalarIndex());
|
||||
cellCenterDataAccessObject = eclipseCase->resultAccessor(grid, porosityModel, timeStepIndex, cellResultSlot->gridScalarIndex());
|
||||
}
|
||||
|
||||
CVF_ASSERT(cellEdgeResultSlot->hasResult());
|
||||
@ -140,7 +140,7 @@ void RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo(
|
||||
{
|
||||
// Assuming static values to be mapped onto cell edge, always using time step zero
|
||||
// TODO: Now hardcoded matrix results, should it be possible to use fracture results?
|
||||
daObj = eclipseCase->dataAccessObject(grid, RifReaderInterface::MATRIX_RESULTS, 0, resultIndices[cubeFaceIdx]);
|
||||
daObj = eclipseCase->resultAccessor(grid, RifReaderInterface::MATRIX_RESULTS, 0, resultIndices[cubeFaceIdx]);
|
||||
}
|
||||
|
||||
cellEdgeDataAccessObjects.push_back(daObj.p());
|
||||
|
@ -90,7 +90,7 @@ public:
|
||||
texCoords.resize(m_quadsToGridCells.size()*4);
|
||||
for (i = 0; i < m_quadsToGridCells.size(); ++i)
|
||||
{
|
||||
cvf::Vec2f texCoord = scalarMapper->mapToTextureCoord(dataAccessObject->cellScalar(m_quadsToGridCells[i]));
|
||||
cvf::Vec2f texCoord = scalarMapper->mapToTextureCoord(resultAccessor->cellScalar(m_quadsToGridCells[i]));
|
||||
ResValue ResPoint To ResValue
|
||||
texCoords[i*4 + 0] = texCoord;
|
||||
texCoords[i*4 + 1] = texCoord;
|
||||
|
@ -203,9 +203,9 @@ void RivFaultGeometryGenerator::computeArrays()
|
||||
/// Calculates the texture coordinates in a "nearly" one dimensional texture.
|
||||
/// Undefined values are coded with a y-texture coordinate value of 1.0 instead of the normal 0.5
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivFaultGeometryGenerator::textureCoordinates(cvf::Vec2fArray* textureCoords, const cvf::StructGridScalarDataAccess* dataAccessObject, const cvf::ScalarMapper* mapper) const
|
||||
void RivFaultGeometryGenerator::textureCoordinates(cvf::Vec2fArray* textureCoords, const cvf::StructGridScalarDataAccess* resultAccessor, const cvf::ScalarMapper* mapper) const
|
||||
{
|
||||
if (!dataAccessObject) return;
|
||||
if (!resultAccessor) return;
|
||||
|
||||
size_t numVertices = m_quadMapper->quadCount()*4;
|
||||
|
||||
@ -218,7 +218,7 @@ void RivFaultGeometryGenerator::textureCoordinates(cvf::Vec2fArray* textureCoord
|
||||
#pragma omp parallel for private(texCoord, cellScalarValue)
|
||||
for (int i = 0; i < static_cast<int>(m_quadMapper->quadCount()); i++)
|
||||
{
|
||||
cellScalarValue = dataAccessObject->cellScalar(m_quadMapper->cellIndex(i));
|
||||
cellScalarValue = resultAccessor->cellScalar(m_quadMapper->cellIndex(i));
|
||||
texCoord = mapper->mapToTextureCoord(cellScalarValue);
|
||||
if (cellScalarValue == HUGE_VAL || cellScalarValue != cellScalarValue) // a != a is true for NAN's
|
||||
{
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
void setCellVisibility(const cvf::UByteArray* cellVisibilities );
|
||||
|
||||
void textureCoordinates(cvf::Vec2fArray* textureCoords,
|
||||
const cvf::StructGridScalarDataAccess* dataAccessObject,
|
||||
const cvf::StructGridScalarDataAccess* resultAccessor,
|
||||
const cvf::ScalarMapper* mapper) const;
|
||||
|
||||
// Mapping between cells and geometry
|
||||
|
@ -117,7 +117,7 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimResultSlot*
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultSlot->porosityModel());
|
||||
|
||||
RigCaseData* eclipseCase = cellResultSlot->reservoirView()->eclipseCase()->reservoirData();
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObject = eclipseCase->dataAccessObject(m_grid.p(), porosityModel, resTimeStepIdx, scalarSetIndex);
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> resultAccessor = eclipseCase->resultAccessor(m_grid.p(), porosityModel, resTimeStepIdx, scalarSetIndex);
|
||||
|
||||
// Faults
|
||||
if (m_nativeFaultFaces.notNull())
|
||||
@ -139,11 +139,11 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimResultSlot*
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dataAccessObject.isNull())
|
||||
if (resultAccessor.isNull())
|
||||
{
|
||||
return;
|
||||
}
|
||||
m_nativeFaultGenerator->textureCoordinates(m_nativeFaultFacesTextureCoords.p(), dataAccessObject.p(), mapper);
|
||||
m_nativeFaultGenerator->textureCoordinates(m_nativeFaultFacesTextureCoords.p(), resultAccessor.p(), mapper);
|
||||
|
||||
}
|
||||
|
||||
@ -212,12 +212,12 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimResultSlot*
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dataAccessObject.isNull())
|
||||
if (resultAccessor.isNull())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_oppositeFaultGenerator->textureCoordinates(m_oppositeFaultFacesTextureCoords.p(), dataAccessObject.p(), mapper);
|
||||
m_oppositeFaultGenerator->textureCoordinates(m_oppositeFaultFacesTextureCoords.p(), resultAccessor.p(), mapper);
|
||||
}
|
||||
|
||||
if (m_opacityLevel < 1.0f )
|
||||
|
@ -243,10 +243,10 @@ void RivGridPartMgr::updateCellResultColor(size_t timeStepIndex, RimResultSlot*
|
||||
if (cellResultSlot->hasStaticResult()) resTimeStepIdx = 0;
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultSlot->porosityModel());
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObject = eclipseCase->dataAccessObject(m_grid.p(), porosityModel, resTimeStepIdx, scalarSetIndex);
|
||||
if (dataAccessObject.isNull()) return;
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> resultAccessor = eclipseCase->resultAccessor(m_grid.p(), porosityModel, resTimeStepIdx, scalarSetIndex);
|
||||
if (resultAccessor.isNull()) return;
|
||||
|
||||
m_surfaceGenerator.textureCoordinates(m_surfaceFacesTextureCoords.p(), dataAccessObject.p(), mapper);
|
||||
m_surfaceGenerator.textureCoordinates(m_surfaceFacesTextureCoords.p(), resultAccessor.p(), mapper);
|
||||
}
|
||||
|
||||
|
||||
@ -460,9 +460,9 @@ void RivTransmissibilityColorMapper::updateCombinedTransmissibilityTextureCoordi
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultSlot->porosityModel());
|
||||
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectTranX = eclipseCase->dataAccessObject(grid, porosityModel, resTimeStepIdx, tranPosXScalarSetIndex);
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectTranY = eclipseCase->dataAccessObject(grid, porosityModel, resTimeStepIdx, tranPosYScalarSetIndex);
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectTranZ = eclipseCase->dataAccessObject(grid, porosityModel, resTimeStepIdx, tranPosZScalarSetIndex);
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectTranX = eclipseCase->resultAccessor(grid, porosityModel, resTimeStepIdx, tranPosXScalarSetIndex);
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectTranY = eclipseCase->resultAccessor(grid, porosityModel, resTimeStepIdx, tranPosYScalarSetIndex);
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectTranZ = eclipseCase->resultAccessor(grid, porosityModel, resTimeStepIdx, tranPosZScalarSetIndex);
|
||||
|
||||
|
||||
int quadCount = static_cast<int>(quadToCellFaceMapper->quadCount());
|
||||
@ -601,19 +601,19 @@ void RivTransmissibilityColorMapper::updateTernarySaturationColorArray(size_t ti
|
||||
|
||||
cellResultSlot->ternaryLegendConfig()->ternaryRanges(soilMin, soilMax, sgasMin, sgasMax, swatMin, swatMax);
|
||||
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectSoil = eclipseCase->dataAccessObject(grid, porosityModel, timeStepIndex, soilScalarSetIndex);
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectSoil = eclipseCase->resultAccessor(grid, porosityModel, timeStepIndex, soilScalarSetIndex);
|
||||
if (dataAccessObjectSoil.isNull())
|
||||
{
|
||||
dataAccessObjectSoil = new ScalarDataAccessZeroForAllCells;
|
||||
}
|
||||
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectSgas = eclipseCase->dataAccessObject(grid, porosityModel, timeStepIndex, sgasScalarSetIndex);
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectSgas = eclipseCase->resultAccessor(grid, porosityModel, timeStepIndex, sgasScalarSetIndex);
|
||||
if (dataAccessObjectSgas.isNull())
|
||||
{
|
||||
dataAccessObjectSgas = new ScalarDataAccessZeroForAllCells;
|
||||
}
|
||||
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectSwat = eclipseCase->dataAccessObject(grid, porosityModel, timeStepIndex, swatScalarSetIndex);
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectSwat = eclipseCase->resultAccessor(grid, porosityModel, timeStepIndex, swatScalarSetIndex);
|
||||
if (dataAccessObjectSwat.isNull())
|
||||
{
|
||||
dataAccessObjectSwat = new ScalarDataAccessZeroForAllCells;
|
||||
|
@ -728,8 +728,8 @@ void RivReservoirViewPartMgr::computePropertyVisibility(cvf::UByteArray* cellVis
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel((*pfIt)->resultDefinition()->porosityModel());
|
||||
RigCaseData* eclipseCase = propFilterColl->reservoirView()->eclipseCase()->reservoirData();
|
||||
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObject = eclipseCase->dataAccessObject(grid, porosityModel, adjustedTimeStepIndex, scalarResultIndex);
|
||||
CVF_ASSERT(dataAccessObject.notNull());
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> resultAccessor = eclipseCase->resultAccessor(grid, porosityModel, adjustedTimeStepIndex, scalarResultIndex);
|
||||
CVF_ASSERT(resultAccessor.notNull());
|
||||
|
||||
//#pragma omp parallel for schedule(dynamic)
|
||||
for (int cellIndex = 0; cellIndex < static_cast<int>(grid->cellCount()); cellIndex++)
|
||||
@ -738,7 +738,7 @@ void RivReservoirViewPartMgr::computePropertyVisibility(cvf::UByteArray* cellVis
|
||||
{
|
||||
size_t resultValueIndex = cellIndex;
|
||||
|
||||
double scalarValue = dataAccessObject->cellScalar(resultValueIndex);
|
||||
double scalarValue = resultAccessor->cellScalar(resultValueIndex);
|
||||
if (lowerBound <= scalarValue && scalarValue <= upperBound)
|
||||
{
|
||||
if (filterType == RimCellFilter::EXCLUDE)
|
||||
|
@ -1105,7 +1105,7 @@ void RimReservoirView::appendCellResultInfo(size_t gridIndex, size_t cellIndex,
|
||||
RigGridBase* grid = eclipseCase->grid(gridIndex);
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResult()->porosityModel());
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObject;
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> resultAccessor;
|
||||
|
||||
if (this->cellResult()->isTernarySaturationSelected())
|
||||
{
|
||||
@ -1116,9 +1116,9 @@ void RimReservoirView::appendCellResultInfo(size_t gridIndex, size_t cellIndex,
|
||||
size_t sgasScalarSetIndex = gridCellResults->findOrLoadScalarResult(RimDefines::DYNAMIC_NATIVE, "SGAS");
|
||||
size_t swatScalarSetIndex = gridCellResults->findOrLoadScalarResult(RimDefines::DYNAMIC_NATIVE, "SWAT");
|
||||
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectX = eclipseCase->dataAccessObject(grid, porosityModel, m_currentTimeStep, soilScalarSetIndex);
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectY = eclipseCase->dataAccessObject(grid, porosityModel, m_currentTimeStep, sgasScalarSetIndex);
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectZ = eclipseCase->dataAccessObject(grid, porosityModel, m_currentTimeStep, swatScalarSetIndex);
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectX = eclipseCase->resultAccessor(grid, porosityModel, m_currentTimeStep, soilScalarSetIndex);
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectY = eclipseCase->resultAccessor(grid, porosityModel, m_currentTimeStep, sgasScalarSetIndex);
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectZ = eclipseCase->resultAccessor(grid, porosityModel, m_currentTimeStep, swatScalarSetIndex);
|
||||
|
||||
double scalarValue = 0.0;
|
||||
|
||||
@ -1138,7 +1138,7 @@ void RimReservoirView::appendCellResultInfo(size_t gridIndex, size_t cellIndex,
|
||||
else if (this->cellResult()->hasResult())
|
||||
{
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResult()->porosityModel());
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObject;
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> resultAccessor;
|
||||
|
||||
if (cellResult->hasStaticResult())
|
||||
{
|
||||
@ -1147,9 +1147,9 @@ void RimReservoirView::appendCellResultInfo(size_t gridIndex, size_t cellIndex,
|
||||
size_t tranX, tranY, tranZ;
|
||||
if (eclipseCase->results(porosityModel)->findTransmissibilityResults(tranX, tranY, tranZ))
|
||||
{
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectX = eclipseCase->dataAccessObject(grid, porosityModel, 0, tranX);
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectY = eclipseCase->dataAccessObject(grid, porosityModel, 0, tranY);
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectZ = eclipseCase->dataAccessObject(grid, porosityModel, 0, tranZ);
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectX = eclipseCase->resultAccessor(grid, porosityModel, 0, tranX);
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectY = eclipseCase->resultAccessor(grid, porosityModel, 0, tranY);
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectZ = eclipseCase->resultAccessor(grid, porosityModel, 0, tranZ);
|
||||
|
||||
double scalarValue = dataAccessObjectX->cellScalar(cellIndex);
|
||||
resultInfoText->append(QString("Tran X : %1\n").arg(scalarValue));
|
||||
@ -1163,17 +1163,17 @@ void RimReservoirView::appendCellResultInfo(size_t gridIndex, size_t cellIndex,
|
||||
}
|
||||
else
|
||||
{
|
||||
dataAccessObject = eclipseCase->dataAccessObject(grid, porosityModel, 0, this->cellResult()->gridScalarIndex());
|
||||
resultAccessor = eclipseCase->resultAccessor(grid, porosityModel, 0, this->cellResult()->gridScalarIndex());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dataAccessObject = eclipseCase->dataAccessObject(grid, porosityModel, m_currentTimeStep, this->cellResult()->gridScalarIndex());
|
||||
resultAccessor = eclipseCase->resultAccessor(grid, porosityModel, m_currentTimeStep, this->cellResult()->gridScalarIndex());
|
||||
}
|
||||
|
||||
if (dataAccessObject.notNull())
|
||||
if (resultAccessor.notNull())
|
||||
{
|
||||
double scalarValue = dataAccessObject->cellScalar(cellIndex);
|
||||
double scalarValue = resultAccessor->cellScalar(cellIndex);
|
||||
resultInfoText->append(QString("Cell result : %1\n").arg(scalarValue));
|
||||
}
|
||||
}
|
||||
@ -1191,10 +1191,10 @@ void RimReservoirView::appendCellResultInfo(size_t gridIndex, size_t cellIndex,
|
||||
|
||||
// Cell edge results are static, results are loaded for first time step only
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResult()->porosityModel());
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObject = eclipseCase->dataAccessObject(grid, porosityModel, 0, resultIndices[idx]);
|
||||
if (dataAccessObject.notNull())
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> resultAccessor = eclipseCase->resultAccessor(grid, porosityModel, 0, resultIndices[idx]);
|
||||
if (resultAccessor.notNull())
|
||||
{
|
||||
double scalarValue = dataAccessObject->cellScalar(cellIndex);
|
||||
double scalarValue = resultAccessor->cellScalar(cellIndex);
|
||||
resultInfoText->append(QString("%1 : %2\n").arg(resultNames[idx]).arg(scalarValue));
|
||||
}
|
||||
}
|
||||
|
@ -194,15 +194,15 @@ void RimStatisticsCaseEvaluator::evaluateForResults(const QList<ResSpec>& result
|
||||
|
||||
size_t scalarResultIndex = sourceCase->results(poroModel)->findOrLoadScalarResultForTimeStep(resultType, resultName, dataAccessTimeStepIndex);
|
||||
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObject = sourceCase->reservoirData()->dataAccessObject(grid, poroModel, dataAccessTimeStepIndex, scalarResultIndex);
|
||||
if (dataAccessObject.notNull())
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> resultAccessor = sourceCase->reservoirData()->resultAccessor(grid, poroModel, dataAccessTimeStepIndex, scalarResultIndex);
|
||||
if (resultAccessor.notNull())
|
||||
{
|
||||
sourceDataAccessList.push_back(dataAccessObject.p());
|
||||
sourceDataAccessList.push_back(resultAccessor.p());
|
||||
}
|
||||
}
|
||||
|
||||
// Build data access objects for destination scalar results
|
||||
// Find the created result container, if any, and put its dataAccessObject into the enum indexed destination collection
|
||||
// Find the created result container, if any, and put its resultAccessor into the enum indexed destination collection
|
||||
|
||||
cvf::Collection<cvf::StructGridScalarDataAccess> destinationDataAccessList;
|
||||
std::vector<QString> statisticalResultNames(STAT_PARAM_COUNT);
|
||||
@ -221,7 +221,7 @@ void RimStatisticsCaseEvaluator::evaluateForResults(const QList<ResSpec>& result
|
||||
size_t scalarResultIndex = destCellResultsData->findScalarResultIndex(resultType, statisticalResultNames[stIdx]);
|
||||
if (scalarResultIndex != cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
destinationDataAccessList.push_back(m_destinationCase->dataAccessObject(grid, poroModel, dataAccessTimeStepIndex, scalarResultIndex).p());
|
||||
destinationDataAccessList.push_back(m_destinationCase->resultAccessor(grid, poroModel, dataAccessTimeStepIndex, scalarResultIndex).p());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -351,12 +351,12 @@ void RimStatisticsCaseEvaluator::debugOutput(RimDefines::ResultCatType resultTyp
|
||||
|
||||
size_t scalarResultIndex = m_destinationCase->results(RifReaderInterface::MATRIX_RESULTS)->findScalarResultIndex(resultType, resultName);
|
||||
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObject = m_destinationCase->dataAccessObject(m_destinationCase->mainGrid(), RifReaderInterface::MATRIX_RESULTS, timeStepIdx, scalarResultIndex);
|
||||
if (dataAccessObject.isNull()) return;
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> resultAccessor = m_destinationCase->resultAccessor(m_destinationCase->mainGrid(), RifReaderInterface::MATRIX_RESULTS, timeStepIdx, scalarResultIndex);
|
||||
if (resultAccessor.isNull()) return;
|
||||
|
||||
for (size_t cellIdx = 0; cellIdx < m_globalCellCount; cellIdx++)
|
||||
{
|
||||
qDebug() << dataAccessObject->cellScalar(cellIdx);
|
||||
qDebug() << resultAccessor->cellScalar(cellIdx);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -488,7 +488,7 @@ const RigCaseCellResultsData* RigCaseData::results(RifReaderInterface::PorosityM
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> RigCaseData::dataAccessObject(const RigGridBase* grid,
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> RigCaseData::resultAccessor(const RigGridBase* grid,
|
||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
size_t scalarSetIndex)
|
||||
|
@ -54,7 +54,7 @@ public:
|
||||
void setActiveCellInfo(RifReaderInterface::PorosityModelResultType porosityModel, RigActiveCellInfo* activeCellInfo);
|
||||
|
||||
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObject(const RigGridBase* grid,
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> resultAccessor(const RigGridBase* grid,
|
||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
size_t scalarSetIndex);
|
||||
|
@ -188,9 +188,9 @@ void RivGridPartMgr::updateCellResultColor(size_t timeStepIndex, RimResultSlot*
|
||||
if (cellResultSlot->hasStaticResult()) resTimeStepIdx = 0;
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultSlot->porosityModel());
|
||||
cvf::ref<RigResultAccessObject> dataAccessObject = RigResultAccessObjectFactory::createResultAccessObject(eclipseCase, m_grid->gridIdx(), porosityModel, resTimeStepIdx, cellResultSlot->resultVariable());
|
||||
cvf::ref<RigResultAccessObject> resultAccessor = RigResultAccessObjectFactory::createResultAccessObject(eclipseCase, m_grid->gridIdx(), porosityModel, resTimeStepIdx, cellResultSlot->resultVariable());
|
||||
|
||||
if (dataAccessObject.isNull()) return;
|
||||
if (resultAccessor.isNull()) return;
|
||||
|
||||
RivResultToTextureMapper texMapper(mapper,
|
||||
RigPipeInCellEvaluator(cellResultSlot->reservoirView()->wellCollection()->isWellPipesVisible(timeStepIndex),
|
||||
@ -210,7 +210,7 @@ void RivGridPartMgr::updateCellResultColor(size_t timeStepIndex, RimResultSlot*
|
||||
{
|
||||
StructGridInterface::FaceType faceId = m_quadMapper->cellFace(i);
|
||||
|
||||
cellScalarValue = dataAccessObject->cellFaceScalar(m_quadMapper->cellIndex(i), faceId);
|
||||
cellScalarValue = resultAccessor->cellFaceScalar(m_quadMapper->cellIndex(i), faceId);
|
||||
|
||||
texCoord = texMapper->mapToTextureCoord(cellScalarValue);
|
||||
|
||||
|
@ -322,7 +322,7 @@ public:
|
||||
|
||||
for (size_t tsIdx = 0; tsIdx < timestepCount; tsIdx++)
|
||||
{
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> cellCenterDataAccessObject = rimCase->reservoirData()->dataAccessObject(rigGrid, porosityModelEnum, requestedTimesteps[tsIdx], scalarResultIndex);
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> cellCenterDataAccessObject = rimCase->reservoirData()->resultAccessor(rigGrid, porosityModelEnum, requestedTimesteps[tsIdx], scalarResultIndex);
|
||||
if (cellCenterDataAccessObject.isNull())
|
||||
{
|
||||
continue;
|
||||
@ -935,7 +935,7 @@ public:
|
||||
}
|
||||
|
||||
cvf::ref<cvf::StructGridScalarDataAccess> cellCenterDataAccessObject =
|
||||
m_currentReservoir->reservoirData()->dataAccessObject(grid, m_porosityModelEnum, m_requestedTimesteps[m_currentTimeStepNumberToRead], m_currentScalarIndex);
|
||||
m_currentReservoir->reservoirData()->resultAccessor(grid, m_porosityModelEnum, m_requestedTimesteps[m_currentTimeStepNumberToRead], m_currentScalarIndex);
|
||||
|
||||
if (!cellCenterDataAccessObject.isNull())
|
||||
{
|
||||
|
@ -383,9 +383,9 @@ void StructGridGeometryGenerator::computeArrays()
|
||||
/// Calculates the texture coordinates in a "nearly" one dimentional texture.
|
||||
/// Undefined values are coded with a y-texturecoordinate value of 1.0 instead of the normal 0.5
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void StructGridGeometryGenerator::textureCoordinates(Vec2fArray* textureCoords, const StructGridScalarDataAccess* dataAccessObject, const ScalarMapper* mapper) const
|
||||
void StructGridGeometryGenerator::textureCoordinates(Vec2fArray* textureCoords, const StructGridScalarDataAccess* resultAccessor, const ScalarMapper* mapper) const
|
||||
{
|
||||
if (!dataAccessObject) return;
|
||||
if (!resultAccessor) return;
|
||||
|
||||
size_t numVertices = m_quadMapper->quadCount()*4;
|
||||
|
||||
@ -398,7 +398,7 @@ void StructGridGeometryGenerator::textureCoordinates(Vec2fArray* textureCoords,
|
||||
#pragma omp parallel for private(texCoord, cellScalarValue)
|
||||
for (int i = 0; i < static_cast<int>(m_quadMapper->quadCount()); i++)
|
||||
{
|
||||
cellScalarValue = dataAccessObject->cellScalar(m_quadMapper->cellIndex(i));
|
||||
cellScalarValue = resultAccessor->cellScalar(m_quadMapper->cellIndex(i));
|
||||
texCoord = mapper->mapToTextureCoord(cellScalarValue);
|
||||
if (cellScalarValue == HUGE_VAL || cellScalarValue != cellScalarValue) // a != a is true for NAN's
|
||||
{
|
||||
@ -418,9 +418,9 @@ void StructGridGeometryGenerator::textureCoordinates(Vec2fArray* textureCoords,
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void StructGridGeometryGenerator::textureCoordinatesFromSingleFaceValues(Vec2fArray* textureCoords, const ScalarMapper* mapper, const CellFaceValueCalculator* dataAccessObject) const
|
||||
void StructGridGeometryGenerator::textureCoordinatesFromSingleFaceValues(Vec2fArray* textureCoords, const ScalarMapper* mapper, const CellFaceValueCalculator* resultAccessor) const
|
||||
{
|
||||
if (!dataAccessObject) return;
|
||||
if (!resultAccessor) return;
|
||||
|
||||
textureCoords->resize(m_quadMapper->quadCount()*4);
|
||||
|
||||
@ -433,7 +433,7 @@ void StructGridGeometryGenerator::textureCoordinatesFromSingleFaceValues(Vec2fAr
|
||||
#pragma omp parallel for private(texCoord, cellFaceValue)
|
||||
for (int qIdx = 0; qIdx < quadCount; qIdx++)
|
||||
{
|
||||
cellFaceValue = dataAccessObject->cellFaceScalar(m_quadMapper->cellIndex(qIdx), m_quadMapper->faceType(qIdx));
|
||||
cellFaceValue = resultAccessor->cellFaceScalar(m_quadMapper->cellIndex(qIdx), m_quadMapper->faceType(qIdx));
|
||||
|
||||
texCoord = mapper->mapToTextureCoord(cellFaceValue);
|
||||
|
||||
|
@ -173,7 +173,7 @@ public:
|
||||
|
||||
const StructGridInterface* activeGrid() { return m_grid.p(); }
|
||||
|
||||
void textureCoordinates(Vec2fArray* textureCoords, const StructGridScalarDataAccess* dataAccessObject, const ScalarMapper* mapper) const;
|
||||
void textureCoordinates(Vec2fArray* textureCoords, const StructGridScalarDataAccess* resultAccessor, const ScalarMapper* mapper) const;
|
||||
|
||||
// Mapping between cells and geometry
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user