diff --git a/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp b/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp index 563c2d66d8..11a7335234 100644 --- a/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp +++ b/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp @@ -212,11 +212,11 @@ std::map RifEclipseInputFileTools::readProperties(const QStri ecl_kw_type* eclKeyWordData = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false , ECL_FLOAT_TYPE); if (eclKeyWordData) { - QString newResultName = reservoir->mainGrid()->results()->makeResultNameUnique(fileKeywords[i].keyword); + QString newResultName = reservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->makeResultNameUnique(fileKeywords[i].keyword); - size_t resultIndex = reservoir->mainGrid()->results()->addEmptyScalarResult(RimDefines::INPUT_PROPERTY, newResultName); // Should really merge with inputProperty object information because we need to use PropertyName, and not keyword + size_t resultIndex = reservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->addEmptyScalarResult(RimDefines::INPUT_PROPERTY, newResultName); // Should really merge with inputProperty object information because we need to use PropertyName, and not keyword - std::vector< std::vector >& newPropertyData = reservoir->mainGrid()->results()->cellScalarResults(resultIndex); + std::vector< std::vector >& newPropertyData = reservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(resultIndex); newPropertyData.push_back(std::vector()); newPropertyData[0].resize(ecl_kw_get_size(eclKeyWordData), HUGE_VAL); ecl_kw_get_data_as_double(eclKeyWordData, newPropertyData[0].data()); @@ -294,13 +294,13 @@ bool RifEclipseInputFileTools::readProperty(const QString& fileName, RigReservoi if (eclKeyWordData) { QString newResultName = resultName; - size_t resultIndex = reservoir->mainGrid()->results()->findScalarResultIndex(newResultName); + size_t resultIndex = reservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->findScalarResultIndex(newResultName); if (resultIndex == cvf::UNDEFINED_SIZE_T) { - resultIndex = reservoir->mainGrid()->results()->addEmptyScalarResult(RimDefines::INPUT_PROPERTY, newResultName); + resultIndex = reservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->addEmptyScalarResult(RimDefines::INPUT_PROPERTY, newResultName); } - std::vector< std::vector >& newPropertyData = reservoir->mainGrid()->results()->cellScalarResults(resultIndex); + std::vector< std::vector >& newPropertyData = reservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(resultIndex); newPropertyData.resize(1); newPropertyData[0].resize(ecl_kw_get_size(eclKeyWordData), HUGE_VAL); ecl_kw_get_data_as_double(eclKeyWordData, newPropertyData[0].data()); @@ -374,7 +374,7 @@ bool RifEclipseInputFileTools::writePropertyToTextFile(const QString& fileName, { CVF_ASSERT(reservoir); - size_t resultIndex = reservoir->mainGrid()->results()->findScalarResultIndex(resultName); + size_t resultIndex = reservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->findScalarResultIndex(resultName); if (resultIndex == cvf::UNDEFINED_SIZE_T) { return false; @@ -386,7 +386,7 @@ bool RifEclipseInputFileTools::writePropertyToTextFile(const QString& fileName, return false; } - std::vector< std::vector >& resultData = reservoir->mainGrid()->results()->cellScalarResults(resultIndex); + std::vector< std::vector >& resultData = reservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(resultIndex); if (resultData.size() == 0) { return false; @@ -402,11 +402,11 @@ bool RifEclipseInputFileTools::writePropertyToTextFile(const QString& fileName, /// Create and write a result vector with values for all cells. /// undefinedValue is used for cells with no result //-------------------------------------------------------------------------------------------------- -bool RifEclipseInputFileTools::writeBinaryResultToTextFile(const QString& fileName, RigReservoir* reservoir, size_t timeStep, const QString& resultName, const QString& eclipseKeyWord, const double undefinedValue) +bool RifEclipseInputFileTools::writeBinaryResultToTextFile(const QString& fileName, RigReservoir* reservoir, RifReaderInterface::PorosityModelResultType porosityModel, size_t timeStep, const QString& resultName, const QString& eclipseKeyWord, const double undefinedValue) { CVF_ASSERT(reservoir); - size_t resultIndex = reservoir->mainGrid()->results()->findScalarResultIndex(resultName); + size_t resultIndex = reservoir->mainGrid()->results(porosityModel)->findScalarResultIndex(resultName); if (resultIndex == cvf::UNDEFINED_SIZE_T) { return false; @@ -418,7 +418,7 @@ bool RifEclipseInputFileTools::writeBinaryResultToTextFile(const QString& fileNa return false; } - cvf::ref dataAccessObject = reservoir->mainGrid()->dataAccessObject(timeStep, resultIndex); + cvf::ref dataAccessObject = reservoir->mainGrid()->dataAccessObject(porosityModel, timeStep, resultIndex); if (dataAccessObject.isNull()) { return false; @@ -532,13 +532,13 @@ bool RifEclipseInputFileTools::readPropertyAtFilePosition(const QString& fileNam if (eclKeyWordData) { QString newResultName = resultName; - size_t resultIndex = reservoir->mainGrid()->results()->findScalarResultIndex(newResultName); + size_t resultIndex = reservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->findScalarResultIndex(newResultName); if (resultIndex == cvf::UNDEFINED_SIZE_T) { - resultIndex = reservoir->mainGrid()->results()->addEmptyScalarResult(RimDefines::INPUT_PROPERTY, newResultName); + resultIndex = reservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->addEmptyScalarResult(RimDefines::INPUT_PROPERTY, newResultName); } - std::vector< std::vector >& newPropertyData = reservoir->mainGrid()->results()->cellScalarResults(resultIndex); + std::vector< std::vector >& newPropertyData = reservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(resultIndex); newPropertyData.resize(1); newPropertyData[0].resize(ecl_kw_get_size(eclKeyWordData), HUGE_VAL); ecl_kw_get_data_as_double(eclKeyWordData, newPropertyData[0].data()); diff --git a/ApplicationCode/FileInterface/RifEclipseInputFileTools.h b/ApplicationCode/FileInterface/RifEclipseInputFileTools.h index d0c264b28c..220454ee6d 100644 --- a/ApplicationCode/FileInterface/RifEclipseInputFileTools.h +++ b/ApplicationCode/FileInterface/RifEclipseInputFileTools.h @@ -24,6 +24,7 @@ #include #include +#include "RifReaderInterface.h" class RigReservoir; @@ -63,7 +64,7 @@ public: static const std::vector& knownPropertyKeywords(); static bool writePropertyToTextFile(const QString& fileName, RigReservoir* reservoir, size_t timeStep, const QString& resultName, const QString& eclipseKeyWord); - static bool writeBinaryResultToTextFile(const QString& fileName, RigReservoir* reservoir, size_t timeStep, const QString& resultName, const QString& eclipseKeyWord, const double undefinedValue); + static bool writeBinaryResultToTextFile(const QString& fileName, RigReservoir* reservoir, RifReaderInterface::PorosityModelResultType porosityModel, size_t timeStep, const QString& resultName, const QString& eclipseKeyWord, const double undefinedValue); private: static void writeDataToTextFile(QFile* file, const QString& eclipseKeyWord, const std::vector& resultData); diff --git a/ApplicationCode/FileInterface/RifEclipseRestartDataAccess.h b/ApplicationCode/FileInterface/RifEclipseRestartDataAccess.h index 4f9fe4d1fc..86e5c34d1d 100644 --- a/ApplicationCode/FileInterface/RifEclipseRestartDataAccess.h +++ b/ApplicationCode/FileInterface/RifEclipseRestartDataAccess.h @@ -49,7 +49,7 @@ public: virtual QStringList timeStepsText() = 0; virtual QList timeSteps() = 0; - virtual QStringList resultNames() = 0; + virtual QStringList resultNames(RifReaderInterface::PorosityModelResultType matrixOrFracture) = 0; virtual bool results(const QString& resultName, RifReaderInterface::PorosityModelResultType matrixOrFracture, size_t timeStep, std::vector* values) = 0; virtual void readWellData(well_info_type * well_info) = 0; diff --git a/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.cpp b/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.cpp index 3f69f9360b..1a45f0e321 100644 --- a/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.cpp +++ b/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.cpp @@ -127,13 +127,13 @@ QList RifEclipseRestartFilesetAccess::timeSteps() //-------------------------------------------------------------------------------------------------- /// Get list of result names //-------------------------------------------------------------------------------------------------- -QStringList RifEclipseRestartFilesetAccess::resultNames() +QStringList RifEclipseRestartFilesetAccess::resultNames(RifReaderInterface::PorosityModelResultType matrixOrFracture) { CVF_ASSERT(numTimeSteps() > 0); // Get the results found on the first file QStringList resultsList; - m_files[0]->validKeywords(&resultsList, RifReaderInterface::MATRIX_RESULTS); + m_files[0]->validKeywords(&resultsList, matrixOrFracture); return resultsList; } diff --git a/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.h b/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.h index a6a57c842f..f7e65407a6 100644 --- a/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.h +++ b/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.h @@ -42,7 +42,7 @@ public: QStringList timeStepsText(); QList timeSteps(); - QStringList resultNames(); + QStringList resultNames(RifReaderInterface::PorosityModelResultType matrixOrFracture); bool results(const QString& resultName, RifReaderInterface::PorosityModelResultType matrixOrFracture, size_t timeStep, std::vector* values); virtual void readWellData(well_info_type* well_info); diff --git a/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.cpp b/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.cpp index 782fc600ab..22980acf4b 100644 --- a/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.cpp +++ b/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.cpp @@ -113,11 +113,11 @@ QList RifEclipseUnifiedRestartFileAccess::timeSteps() //-------------------------------------------------------------------------------------------------- /// Get list of result names //-------------------------------------------------------------------------------------------------- -QStringList RifEclipseUnifiedRestartFileAccess::resultNames() +QStringList RifEclipseUnifiedRestartFileAccess::resultNames(RifReaderInterface::PorosityModelResultType matrixOrFracture) { // Get the results found on the UNRST file QStringList resultsList; - m_file->validKeywords(&resultsList, RifReaderInterface::MATRIX_RESULTS); + m_file->validKeywords(&resultsList, matrixOrFracture); return resultsList; } diff --git a/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.h b/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.h index 59c5a5d4e7..411ca8335e 100644 --- a/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.h +++ b/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.h @@ -42,7 +42,7 @@ public: QStringList timeStepsText(); QList timeSteps(); - QStringList resultNames(); + QStringList resultNames(RifReaderInterface::PorosityModelResultType matrixOrFracture); bool results(const QString& resultName, RifReaderInterface::PorosityModelResultType matrixOrFracture, size_t timeStep, std::vector* values); virtual void readWellData(well_info_type * well_info); diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp index 3a95e7199d..6eddfcc0c2 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp @@ -26,6 +26,7 @@ #include "RifEclipseOutputFileTools.h" #include "RifEclipseUnifiedRestartFileAccess.h" #include "RifEclipseRestartFilesetAccess.h" +#include "RifReaderInterface.h" #include @@ -370,21 +371,34 @@ bool RifReaderEclipseOutput::buildMetaData(RigReservoir* reservoir) return false; } - RigReservoirCellResults* resCellResults = reservoir->mainGrid()->results(); + RigReservoirCellResults* matrixModelResults = reservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS); + RigReservoirCellResults* fractureModelResults = reservoir->mainGrid()->results(RifReaderInterface::FRACTURE_RESULTS); if (m_dynamicResultsAccess.notNull()) { // Get time steps m_timeSteps = m_dynamicResultsAccess->timeSteps(); - // Get the names of the dynamic results - QStringList dynamicResultNames = m_dynamicResultsAccess->resultNames(); - - for (int i = 0; i < dynamicResultNames.size(); ++i) { - size_t resIndex = resCellResults->addEmptyScalarResult(RimDefines::DYNAMIC_NATIVE, dynamicResultNames[i]); - resCellResults->setTimeStepDates(resIndex, m_timeSteps); + QStringList dynamicResultNames = m_dynamicResultsAccess->resultNames(RifReaderInterface::MATRIX_RESULTS); + + for (int i = 0; i < dynamicResultNames.size(); ++i) + { + size_t resIndex = matrixModelResults->addEmptyScalarResult(RimDefines::DYNAMIC_NATIVE, dynamicResultNames[i]); + matrixModelResults->setTimeStepDates(resIndex, m_timeSteps); + } } + + { + QStringList dynamicResultNames = m_dynamicResultsAccess->resultNames(RifReaderInterface::FRACTURE_RESULTS); + + for (int i = 0; i < dynamicResultNames.size(); ++i) + { + size_t resIndex = fractureModelResults->addEmptyScalarResult(RimDefines::DYNAMIC_NATIVE, dynamicResultNames[i]); + fractureModelResults->setTimeStepDates(resIndex, m_timeSteps); + } + } + } progInfo.setProgress(1); @@ -399,21 +413,40 @@ bool RifReaderEclipseOutput::buildMetaData(RigReservoir* reservoir) return false; } - // Get the names of the static results - QStringList staticResults; - initFile->validKeywords(&staticResults, RifReaderInterface::MATRIX_RESULTS); - QStringList staticResultNames = staticResults; - - QList staticDate; - if (m_timeSteps.size() > 0) { - staticDate.push_back(m_timeSteps.front()); + QStringList staticResults; + initFile->validKeywords(&staticResults, RifReaderInterface::MATRIX_RESULTS); + QStringList staticResultNames = staticResults; + + QList staticDate; + if (m_timeSteps.size() > 0) + { + staticDate.push_back(m_timeSteps.front()); + } + + for (int i = 0; i < staticResultNames.size(); ++i) + { + size_t resIndex = matrixModelResults->addEmptyScalarResult(RimDefines::STATIC_NATIVE, staticResultNames[i]); + matrixModelResults->setTimeStepDates(resIndex, staticDate); + } } - for (int i = 0; i < staticResultNames.size(); ++i) { - size_t resIndex = resCellResults->addEmptyScalarResult(RimDefines::STATIC_NATIVE, staticResultNames[i]); - resCellResults->setTimeStepDates(resIndex, staticDate); + QStringList staticResults; + initFile->validKeywords(&staticResults, RifReaderInterface::FRACTURE_RESULTS); + QStringList staticResultNames = staticResults; + + QList staticDate; + if (m_timeSteps.size() > 0) + { + staticDate.push_back(m_timeSteps.front()); + } + + for (int i = 0; i < staticResultNames.size(); ++i) + { + size_t resIndex = fractureModelResults->addEmptyScalarResult(RimDefines::STATIC_NATIVE, staticResultNames[i]); + fractureModelResults->setTimeStepDates(resIndex, staticDate); + } } m_staticResultsAccess = initFile; diff --git a/ApplicationCode/FileInterface/RifReaderMockModel.cpp b/ApplicationCode/FileInterface/RifReaderMockModel.cpp index 340486f685..0cfb16c02d 100644 --- a/ApplicationCode/FileInterface/RifReaderMockModel.cpp +++ b/ApplicationCode/FileInterface/RifReaderMockModel.cpp @@ -20,6 +20,7 @@ #include "RifReaderMockModel.h" #include "RigReservoirCellResults.h" +#include "RifReaderInterface.h" //-------------------------------------------------------------------------------------------------- /// @@ -30,7 +31,7 @@ bool RifReaderMockModel::open(const QString& fileName, RigReservoir* reservoir) m_reservoir = reservoir; - RigReservoirCellResults* cellResults = reservoir->mainGrid()->results(); + RigReservoirCellResults* cellResults = reservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS); QList dates; diff --git a/ApplicationCode/ModelVisualization/RivCellEdgeEffectGenerator.cpp b/ApplicationCode/ModelVisualization/RivCellEdgeEffectGenerator.cpp index 092a82c444..e05c0b0e8c 100644 --- a/ApplicationCode/ModelVisualization/RivCellEdgeEffectGenerator.cpp +++ b/ApplicationCode/ModelVisualization/RivCellEdgeEffectGenerator.cpp @@ -101,7 +101,8 @@ void RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo( timeStepIndex = 0; } - cellScalarResultUseGlobalActiveIndex = grid->mainGrid()->results()->isUsingGlobalActiveIndex(cellResultSlot->gridScalarIndex()); + RifReaderInterface::PorosityModelResultType porosityModel = RigReservoirCellResults::convertFromProjectModelPorosityModel(cellResultSlot->porosityModel()); + cellScalarResultUseGlobalActiveIndex = grid->mainGrid()->results(porosityModel)->isUsingGlobalActiveIndex(cellResultSlot->gridScalarIndex()); } size_t resultIndices[6]; @@ -114,7 +115,7 @@ void RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo( { if (resultIndices[cubeFaceIdx] != cvf::UNDEFINED_SIZE_T) { - edgeScalarResultUseGlobalActiveIndex[cubeFaceIdx] = grid->mainGrid()->results()->isUsingGlobalActiveIndex(resultIndices[cubeFaceIdx]); + edgeScalarResultUseGlobalActiveIndex[cubeFaceIdx] = grid->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->isUsingGlobalActiveIndex(resultIndices[cubeFaceIdx]); } } } @@ -144,7 +145,8 @@ void RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo( } { - double scalarValue = grid->mainGrid()->results()->cellScalarResult(timeStepIndex, cellResultSlot->gridScalarIndex(), resultValueIndex); + RifReaderInterface::PorosityModelResultType porosityModel = RigReservoirCellResults::convertFromProjectModelPorosityModel(cellResultSlot->porosityModel()); + double scalarValue = grid->mainGrid()->results(porosityModel)->cellScalarResult(timeStepIndex, cellResultSlot->gridScalarIndex(), resultValueIndex); if (scalarValue != HUGE_VAL) { cellColorTextureCoord = cellResultScalarMapper->mapToTextureCoord(scalarValue)[0]; @@ -173,7 +175,7 @@ void RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo( } // Assuming static values to be mapped onto cell edge, always using time step zero - double scalarValue = grid->mainGrid()->results()->cellScalarResult(0, resultIndices[cubeFaceIdx], resultValueIndex); + double scalarValue = grid->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResult(0, resultIndices[cubeFaceIdx], resultValueIndex); if (scalarValue != HUGE_VAL && scalarValue != ignoredScalarValue) { edgeColor = edgeResultScalarMapper->mapToTextureCoord(scalarValue)[0]; diff --git a/ApplicationCode/ModelVisualization/RivGridPartMgr.cpp b/ApplicationCode/ModelVisualization/RivGridPartMgr.cpp index d5c875d19c..1f93252fd3 100644 --- a/ApplicationCode/ModelVisualization/RivGridPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivGridPartMgr.cpp @@ -28,6 +28,7 @@ #include "RimResultSlot.h" #include "RimCellEdgeResultSlot.h" #include "RigGridScalarDataAccess.h" +#include "RigReservoirCellResults.h" //-------------------------------------------------------------------------------------------------- @@ -219,7 +220,8 @@ void RivGridPartMgr::updateCellResultColor(size_t timeStepIndex, RimResultSlot* size_t resTimeStepIdx = timeStepIndex; if (cellResultSlot->hasStaticResult()) resTimeStepIdx = 0; - cvf::ref dataAccessObject = m_grid->dataAccessObject(timeStepIndex, scalarSetIndex); + RifReaderInterface::PorosityModelResultType porosityModel = RigReservoirCellResults::convertFromProjectModelPorosityModel(cellResultSlot->porosityModel()); + cvf::ref dataAccessObject = m_grid->dataAccessObject(porosityModel, timeStepIndex, scalarSetIndex); if (dataAccessObject.isNull()) return; // Outer surface diff --git a/ApplicationCode/ModelVisualization/RivReservoirViewPartMgr.cpp b/ApplicationCode/ModelVisualization/RivReservoirViewPartMgr.cpp index e53221504a..a9d1817e16 100644 --- a/ApplicationCode/ModelVisualization/RivReservoirViewPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivReservoirViewPartMgr.cpp @@ -599,7 +599,8 @@ void RivReservoirViewPartMgr::computePropertyVisibility(cvf::UByteArray* cellVis const RimCellFilter::FilterModeType filterType = (*pfIt)->filterMode(); - cvf::ref dataAccessObject = grid->dataAccessObject(timeStepIndex, scalarResultIndex); + RifReaderInterface::PorosityModelResultType porosityModel = RigReservoirCellResults::convertFromProjectModelPorosityModel((*pfIt)->resultDefinition()->porosityModel()); + cvf::ref dataAccessObject = grid->dataAccessObject(porosityModel, timeStepIndex, scalarResultIndex); CVF_ASSERT(dataAccessObject.notNull()); #pragma omp parallel for schedule(dynamic) diff --git a/ApplicationCode/ProjectDataModel/RimDefines.cpp b/ApplicationCode/ProjectDataModel/RimDefines.cpp index 7cd3f827a3..5002d0c42a 100644 --- a/ApplicationCode/ProjectDataModel/RimDefines.cpp +++ b/ApplicationCode/ProjectDataModel/RimDefines.cpp @@ -34,5 +34,15 @@ namespace caf setDefault(RimDefines::DYNAMIC_NATIVE); } + + template<> + void caf::AppEnum< RimDefines::PorosityModelType >::setUp() + { + addItem(RimDefines::MATRIX_MODEL, "MATRIX_MODEL", "Matrix"); + addItem(RimDefines::FRACTURE_MODEL, "FRACTURE_MODEL", "Fracture"); + + setDefault(RimDefines::MATRIX_MODEL); + } + } diff --git a/ApplicationCode/ProjectDataModel/RimDefines.h b/ApplicationCode/ProjectDataModel/RimDefines.h index 784913ecf2..62e33fa8c3 100644 --- a/ApplicationCode/ProjectDataModel/RimDefines.h +++ b/ApplicationCode/ProjectDataModel/RimDefines.h @@ -33,6 +33,12 @@ public: REMOVED }; + enum PorosityModelType + { + MATRIX_MODEL, + FRACTURE_MODEL + }; + static QString undefinedResultName() { return "None"; } }; diff --git a/ApplicationCode/ProjectDataModel/RimInputReservoir.cpp b/ApplicationCode/ProjectDataModel/RimInputReservoir.cpp index 258639d65f..7e48bcd159 100644 --- a/ApplicationCode/ProjectDataModel/RimInputReservoir.cpp +++ b/ApplicationCode/ProjectDataModel/RimInputReservoir.cpp @@ -72,7 +72,8 @@ void RimInputReservoir::openDataFileSet(const QStringList& filenames) if (caseName().contains("Input Mock Debug Model")) { cvf::ref readerInterface = this->createMockModel(this->caseName()); - m_rigReservoir->mainGrid()->results()->setReaderInterface(readerInterface.p()); + m_rigReservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->setReaderInterface(readerInterface.p()); + m_rigReservoir->mainGrid()->results(RifReaderInterface::FRACTURE_RESULTS)->setReaderInterface(readerInterface.p()); return; } @@ -179,16 +180,21 @@ bool RimInputReservoir::openEclipseGridFile() CVF_ASSERT(m_rigReservoir.notNull()); CVF_ASSERT(readerInterface.notNull()); - m_rigReservoir->mainGrid()->results()->setReaderInterface(readerInterface.p()); + m_rigReservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->setReaderInterface(readerInterface.p()); + m_rigReservoir->mainGrid()->results(RifReaderInterface::FRACTURE_RESULTS)->setReaderInterface(readerInterface.p()); m_rigReservoir->computeFaults(); m_rigReservoir->mainGrid()->computeCachedData(); } - RigReservoirCellResults* results = m_rigReservoir->mainGrid()->results(); + RIApplication* app = RIApplication::instance(); if (app->preferences()->autocomputeDepthRelatedProperties) { - results->computeDepthRelatedResults(); + RigReservoirCellResults* matrixResults = m_rigReservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS); + RigReservoirCellResults* fractureResults = m_rigReservoir->mainGrid()->results(RifReaderInterface::FRACTURE_RESULTS); + + matrixResults->computeDepthRelatedResults(); + fractureResults->computeDepthRelatedResults(); } return true; @@ -277,7 +283,7 @@ void RimInputReservoir::loadAndSyncronizeInputProperties() { if (fileKeywordSet.count(knownKeywords[fkIt])) { - QString resultName = this->reservoirData()->mainGrid()->results()->makeResultNameUnique(knownKeywords[fkIt]); + QString resultName = this->reservoirData()->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->makeResultNameUnique(knownKeywords[fkIt]); if (RifEclipseInputFileTools::readProperty(filenames[i], this->reservoirData(), knownKeywords[fkIt], resultName)) { RimInputProperty* inputProperty = new RimInputProperty; @@ -352,7 +358,7 @@ void RimInputReservoir::removeProperty(RimInputProperty* inputProperty) } // Remove the results pointed to by this input property - RigReservoirCellResults* results = m_rigReservoir->mainGrid()->results(); + RigReservoirCellResults* results = m_rigReservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS); results->removeResult(inputProperty->resultName); this->removeResult(inputProperty->resultName); diff --git a/ApplicationCode/ProjectDataModel/RimReservoir.cpp b/ApplicationCode/ProjectDataModel/RimReservoir.cpp index 4c80f5a4dd..79bd2bf00a 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoir.cpp +++ b/ApplicationCode/ProjectDataModel/RimReservoir.cpp @@ -209,10 +209,16 @@ void RimReservoir::fieldChangedByUi(const caf::PdmFieldHandle* changedField, con reservoirView->createDisplayModelAndRedraw(); } - RigReservoirCellResults* results = m_rigReservoir->mainGrid()->results(); - if (results) + RigReservoirCellResults* matrixModelResults = m_rigReservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS); + if (matrixModelResults) { - results->clearAllResults(); + matrixModelResults->clearAllResults(); + } + + RigReservoirCellResults* fractureModelResults = m_rigReservoir->mainGrid()->results(RifReaderInterface::FRACTURE_RESULTS); + if (fractureModelResults) + { + fractureModelResults->clearAllResults(); } } diff --git a/ApplicationCode/ProjectDataModel/RimReservoirView.cpp b/ApplicationCode/ProjectDataModel/RimReservoirView.cpp index ea1ed31119..4c0269f1d2 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirView.cpp +++ b/ApplicationCode/ProjectDataModel/RimReservoirView.cpp @@ -683,12 +683,11 @@ void RimReservoirView::loadDataAndUpdate() } else { - RigReservoirCellResults* results = gridCellResults(); - CVF_ASSERT(results); - RIApplication* app = RIApplication::instance(); if (app->preferences()->autocomputeSOIL) { + RigReservoirCellResults* results = gridCellResults(); + CVF_ASSERT(results); results->loadOrComputeSOIL(); } } @@ -851,7 +850,8 @@ void RimReservoirView::appendCellResultInfo(size_t gridIndex, size_t cellIndex, const RigGridBase* grid = reservoir->grid(gridIndex); if (this->cellResult()->hasResult()) { - cvf::ref dataAccessObject = grid->dataAccessObject(m_currentTimeStep, this->cellResult()->gridScalarIndex()); + RifReaderInterface::PorosityModelResultType porosityModel = RigReservoirCellResults::convertFromProjectModelPorosityModel(cellResult()->porosityModel()); + cvf::ref dataAccessObject = grid->dataAccessObject(porosityModel, m_currentTimeStep, this->cellResult()->gridScalarIndex()); if (dataAccessObject.notNull()) { double scalarValue = dataAccessObject->cellScalar(cellIndex); @@ -871,7 +871,8 @@ void RimReservoirView::appendCellResultInfo(size_t gridIndex, size_t cellIndex, if (resultIndices[idx] == cvf::UNDEFINED_SIZE_T) continue; // Cell edge results are static, results are loaded for first time step only - cvf::ref dataAccessObject = grid->dataAccessObject(0, resultIndices[idx]); + RifReaderInterface::PorosityModelResultType porosityModel = RigReservoirCellResults::convertFromProjectModelPorosityModel(cellResult()->porosityModel()); + cvf::ref dataAccessObject = grid->dataAccessObject(porosityModel, 0, resultIndices[idx]); if (dataAccessObject.notNull()) { double scalarValue = dataAccessObject->cellScalar(cellIndex); @@ -940,7 +941,9 @@ RigReservoirCellResults* RimReservoirView::gridCellResults() m_reservoir->reservoirData()->mainGrid() ) { - return m_reservoir->reservoirData()->mainGrid()->results(); + RifReaderInterface::PorosityModelResultType porosityModel = RigReservoirCellResults::convertFromProjectModelPorosityModel(cellResult->porosityModel()); + + return m_reservoir->reservoirData()->mainGrid()->results(porosityModel); } return NULL; @@ -1009,7 +1012,8 @@ void RimReservoirView::updateLegends() RigReservoir* reservoir = m_reservoir->reservoirData(); CVF_ASSERT(reservoir); - RigReservoirCellResults* results = reservoir->mainGrid()->results(); + RifReaderInterface::PorosityModelResultType porosityModel = RigReservoirCellResults::convertFromProjectModelPorosityModel(cellResult()->porosityModel()); + RigReservoirCellResults* results = reservoir->mainGrid()->results(porosityModel); CVF_ASSERT(results); if (this->cellResult()->hasResult()) diff --git a/ApplicationCode/ProjectDataModel/RimResultDefinition.cpp b/ApplicationCode/ProjectDataModel/RimResultDefinition.cpp index e354c9ae00..2017d1c5c0 100644 --- a/ApplicationCode/ProjectDataModel/RimResultDefinition.cpp +++ b/ApplicationCode/ProjectDataModel/RimResultDefinition.cpp @@ -38,10 +38,12 @@ RimResultDefinition::RimResultDefinition() { CAF_PDM_InitObject("Result Definition", "", "", ""); - CAF_PDM_InitFieldNoDefault(&resultType, "ResultType", "Type", "", "", ""); + CAF_PDM_InitFieldNoDefault(&resultType, "ResultType", "Type", "", "", ""); + CAF_PDM_InitFieldNoDefault(&porosityModel, "PorosityModelType", "Type", "", "", ""); CAF_PDM_InitField(&resultVariable, "ResultVariable", RimDefines::undefinedResultName(), "Variable", "", "", "" ); resultVariable.setUiEditorTypeName(caf::PdmUiListEditor::uiEditorTypeName()); + porosityModel.setUiHidden(true); } //-------------------------------------------------------------------------------------------------- @@ -82,35 +84,6 @@ QList RimResultDefinition::calculateValueOptions(const c { if (m_reservoirView && m_reservoirView->gridCellResults()) { - /* - QStringList varList; - if (resultType() == RimDefines::DYNAMIC_NATIVE) - { - varList = readerInterface->dynamicResultNames(); - - if (!varList.contains("SOIL", Qt::CaseInsensitive)) - { - // SOIL will be computed in RigReservoirCellResults::loadOrComputeSOIL() if SGAS and SWAT is present - if (varList.contains("SGAS", Qt::CaseInsensitive) && varList.contains("SWAT", Qt::CaseInsensitive)) - { - varList.push_back("SOIL"); - } - } - } - else if (resultType == RimDefines::STATIC_NATIVE) - { - varList = readerInterface->staticResultNames(); - } - else if (resultType == RimDefines::GENERATED) - { - varList = m_reservoirView->eclipseCase()->reservoirData()->mainGrid()->results()->resultNames(resultType()); - } - else if (resultType == RimDefines::INPUT_PROPERTY) - { - varList = readerInterface->inputPropertyNames(); - } - */ - QStringList varList = m_reservoirView->gridCellResults()->resultNames(resultType()); QList optionList; int i; @@ -134,7 +107,7 @@ QList RimResultDefinition::calculateValueOptions(const c //-------------------------------------------------------------------------------------------------- size_t RimResultDefinition::gridScalarIndex() const { - if (m_gridScalarResultIndex == cvf::UNDEFINED_SIZE_T) + if (m_gridScalarResultIndex == cvf::UNDEFINED_SIZE_T) { const RigReservoirCellResults* gridCellResults = m_reservoirView->gridCellResults(); if (gridCellResults) m_gridScalarResultIndex = gridCellResults->findScalarResultIndex(resultType(), resultVariable()); diff --git a/ApplicationCode/ProjectDataModel/RimResultDefinition.h b/ApplicationCode/ProjectDataModel/RimResultDefinition.h index 5805b71f73..a9a159935b 100644 --- a/ApplicationCode/ProjectDataModel/RimResultDefinition.h +++ b/ApplicationCode/ProjectDataModel/RimResultDefinition.h @@ -42,8 +42,9 @@ public: virtual void setReservoirView(RimReservoirView* ownerReservoirView); RimReservoirView* reservoirView(); - caf::PdmField< caf::AppEnum< RimDefines::ResultCatType > > resultType; - caf::PdmField resultVariable; + caf::PdmField< caf::AppEnum< RimDefines::ResultCatType > > resultType; + caf::PdmField< caf::AppEnum< RimDefines::PorosityModelType > > porosityModel; + caf::PdmField resultVariable; void loadResult(); size_t gridScalarIndex() const; diff --git a/ApplicationCode/ProjectDataModel/RimResultReservoir.cpp b/ApplicationCode/ProjectDataModel/RimResultReservoir.cpp index ce45bcac75..244cae3acc 100644 --- a/ApplicationCode/ProjectDataModel/RimResultReservoir.cpp +++ b/ApplicationCode/ProjectDataModel/RimResultReservoir.cpp @@ -89,7 +89,8 @@ bool RimResultReservoir::openEclipseGridFile() CVF_ASSERT(m_rigReservoir.notNull()); CVF_ASSERT(readerInterface.notNull()); - m_rigReservoir->mainGrid()->results()->setReaderInterface(readerInterface.p()); + m_rigReservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->setReaderInterface(readerInterface.p()); + m_rigReservoir->mainGrid()->results(RifReaderInterface::FRACTURE_RESULTS)->setReaderInterface(readerInterface.p()); progInfo.setProgressDescription("Computing Faults"); m_rigReservoir->computeFaults(); diff --git a/ApplicationCode/ProjectDataModel/RimUiTreeView.cpp b/ApplicationCode/ProjectDataModel/RimUiTreeView.cpp index a309bb7522..624104775e 100644 --- a/ApplicationCode/ProjectDataModel/RimUiTreeView.cpp +++ b/ApplicationCode/ProjectDataModel/RimUiTreeView.cpp @@ -30,6 +30,7 @@ #include "RifEclipseInputFileTools.h" #include "RimInputReservoir.h" #include "RimBinaryExportSettings.h" +#include "RigReservoirCellResults.h" //-------------------------------------------------------------------------------------------------- /// @@ -727,7 +728,9 @@ void RimUiTreeView::slotWriteBinaryResultAsInputProperty() if (preferencesDialog.exec() == QDialog::Accepted) { size_t timeStep = resultSlot->reservoirView()->currentTimeStep(); - bool isOk = RifEclipseInputFileTools::writeBinaryResultToTextFile(exportSettings.fileName, resultSlot->reservoirView()->eclipseCase()->reservoirData(), timeStep, resultSlot->resultVariable, exportSettings.eclipseKeyword, exportSettings.undefinedValue); + RifReaderInterface::PorosityModelResultType porosityModel = RigReservoirCellResults::convertFromProjectModelPorosityModel(resultSlot->porosityModel()); + + bool isOk = RifEclipseInputFileTools::writeBinaryResultToTextFile(exportSettings.fileName, resultSlot->reservoirView()->eclipseCase()->reservoirData(), porosityModel, timeStep, resultSlot->resultVariable, exportSettings.eclipseKeyword, exportSettings.undefinedValue); if (!isOk) { QMessageBox::critical(NULL, "File export", "Failed to exported current result to " + exportSettings.fileName); diff --git a/ApplicationCode/ReservoirDataModel/RigGridBase.cpp b/ApplicationCode/ReservoirDataModel/RigGridBase.cpp index 9d2c4dbd1c..c09eccda0a 100644 --- a/ApplicationCode/ReservoirDataModel/RigGridBase.cpp +++ b/ApplicationCode/ReservoirDataModel/RigGridBase.cpp @@ -525,12 +525,12 @@ void RigGridBase::computeMatrixAndFractureModelActiveCellCount() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -cvf::ref RigGridBase::dataAccessObject(size_t timeStepIndex, size_t scalarSetIndex) const +cvf::ref RigGridBase::dataAccessObject(RifReaderInterface::PorosityModelResultType porosityModel, size_t timeStepIndex, size_t scalarSetIndex) const { if (timeStepIndex != cvf::UNDEFINED_SIZE_T && scalarSetIndex != cvf::UNDEFINED_SIZE_T) { - cvf::ref dataAccess = new RigGridScalarDataAccess(this, timeStepIndex, scalarSetIndex); + cvf::ref dataAccess = new RigGridScalarDataAccess(this, porosityModel, timeStepIndex, scalarSetIndex); return dataAccess; } diff --git a/ApplicationCode/ReservoirDataModel/RigGridBase.h b/ApplicationCode/ReservoirDataModel/RigGridBase.h index 9879eb8c27..b70a4574bb 100644 --- a/ApplicationCode/ReservoirDataModel/RigGridBase.h +++ b/ApplicationCode/ReservoirDataModel/RigGridBase.h @@ -28,6 +28,7 @@ #include #include #include "cvfStructGridScalarDataAccess.h" +#include "RifReaderInterface.h" class RigMainGrid; @@ -95,7 +96,7 @@ public: virtual bool isCellValid( size_t i, size_t j, size_t k ) const; virtual bool cellIJKNeighbor(size_t i, size_t j, size_t k, FaceType face, size_t* neighborCellIndex ) const; - cvf::ref dataAccessObject(size_t timeStepIndex, size_t scalarSetIndex) const; + cvf::ref dataAccessObject(RifReaderInterface::PorosityModelResultType porosityModel, size_t timeStepIndex, size_t scalarSetIndex) const; private: std::string m_gridName; diff --git a/ApplicationCode/ReservoirDataModel/RigGridScalarDataAccess.cpp b/ApplicationCode/ReservoirDataModel/RigGridScalarDataAccess.cpp index 8e9bdb1ae1..c7eb3e2411 100644 --- a/ApplicationCode/ReservoirDataModel/RigGridScalarDataAccess.cpp +++ b/ApplicationCode/ReservoirDataModel/RigGridScalarDataAccess.cpp @@ -29,17 +29,17 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigGridScalarDataAccess::RigGridScalarDataAccess(const RigGridBase* grid, size_t timeStepIndex, size_t scalarSetIndex) +RigGridScalarDataAccess::RigGridScalarDataAccess(const RigGridBase* grid, RifReaderInterface::PorosityModelResultType porosityModel, size_t timeStepIndex, size_t scalarSetIndex) { CVF_ASSERT(grid); CVF_ASSERT(grid->mainGrid()); - CVF_ASSERT(grid->mainGrid()->results()); + CVF_ASSERT(grid->mainGrid()->results(porosityModel)); m_grid = grid; - m_useGlobalActiveIndex = m_grid->mainGrid()->results()->isUsingGlobalActiveIndex(scalarSetIndex); + m_useGlobalActiveIndex = m_grid->mainGrid()->results(porosityModel)->isUsingGlobalActiveIndex(scalarSetIndex); - std::vector< std::vector > & scalarSetResults = m_grid->mainGrid()->results()->cellScalarResults(scalarSetIndex); + std::vector< std::vector > & scalarSetResults = m_grid->mainGrid()->results(porosityModel)->cellScalarResults(scalarSetIndex); CVF_ASSERT(timeStepIndex < scalarSetResults.size()); m_resultValues = &(scalarSetResults[timeStepIndex]); diff --git a/ApplicationCode/ReservoirDataModel/RigGridScalarDataAccess.h b/ApplicationCode/ReservoirDataModel/RigGridScalarDataAccess.h index d80198b8e9..5db51ca397 100644 --- a/ApplicationCode/ReservoirDataModel/RigGridScalarDataAccess.h +++ b/ApplicationCode/ReservoirDataModel/RigGridScalarDataAccess.h @@ -21,6 +21,7 @@ #include "cvfStructGridScalarDataAccess.h" #include "RigGridBase.h" +#include "RifReaderInterface.h" //-------------------------------------------------------------------------------------------------- @@ -29,7 +30,7 @@ class RigGridScalarDataAccess : public cvf::StructGridScalarDataAccess { public: - RigGridScalarDataAccess(const RigGridBase* grid, size_t timeStepIndex, size_t scalarSetIndex); + RigGridScalarDataAccess(const RigGridBase* grid, RifReaderInterface::PorosityModelResultType porosityModel, size_t timeStepIndex, size_t scalarSetIndex); virtual double cellScalar(size_t i, size_t j, size_t k) const; virtual double cellScalar(size_t cellIndex) const; diff --git a/ApplicationCode/ReservoirDataModel/RigMainGrid.cpp b/ApplicationCode/ReservoirDataModel/RigMainGrid.cpp index bb3fe81db8..6ce0fd6c52 100644 --- a/ApplicationCode/ReservoirDataModel/RigMainGrid.cpp +++ b/ApplicationCode/ReservoirDataModel/RigMainGrid.cpp @@ -32,7 +32,8 @@ RigMainGrid::RigMainGrid(void) m_globalMatrixModelActiveCellCount(cvf::UNDEFINED_SIZE_T), m_globalFractureModelActiveCellCount(cvf::UNDEFINED_SIZE_T) { - m_results = new RigReservoirCellResults(this); + m_matrixModelResults = new RigReservoirCellResults(this); + m_fractureModelResults = new RigReservoirCellResults(this); m_activeCellsBoundingBox.add(cvf::Vec3d::ZERO); m_gridIndex = 0; @@ -374,3 +375,29 @@ void RigMainGrid::computeGlobalActiveCellCount() if (m_cells[i].isActiveInFractureModel()) m_globalFractureModelActiveCellCount++; } } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RigReservoirCellResults* RigMainGrid::results(RifReaderInterface::PorosityModelResultType porosityModel) +{ + if (porosityModel == RifReaderInterface::MATRIX_RESULTS) + { + return m_matrixModelResults.p(); + } + + return m_fractureModelResults.p(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const RigReservoirCellResults* RigMainGrid::results(RifReaderInterface::PorosityModelResultType porosityModel) const +{ + if (porosityModel == RifReaderInterface::MATRIX_RESULTS) + { + return m_matrixModelResults.p(); + } + + return m_fractureModelResults.p(); +} diff --git a/ApplicationCode/ReservoirDataModel/RigMainGrid.h b/ApplicationCode/ReservoirDataModel/RigMainGrid.h index e0670d83de..fa04eacb52 100644 --- a/ApplicationCode/ReservoirDataModel/RigMainGrid.h +++ b/ApplicationCode/ReservoirDataModel/RigMainGrid.h @@ -23,11 +23,13 @@ #include "RigLocalGrid.h" #include "cvfCollection.h" #include "cvfBoundingBox.h" +#include "RifReaderInterface.h" + #include class RigReservoirCellResults; -class RigMainGrid : public RigGridBase +class RigMainGrid : public RigGridBase { public: RigMainGrid(); @@ -40,8 +42,8 @@ public: std::vector& cells() {return m_cells;} const std::vector& cells() const {return m_cells;} - RigReservoirCellResults* results() {return m_results.p();} - const RigReservoirCellResults* results() const {return m_results.p();} + RigReservoirCellResults* results(RifReaderInterface::PorosityModelResultType porosityModel); + const RigReservoirCellResults* results(RifReaderInterface::PorosityModelResultType porosityModel) const; size_t globalMatrixModelActiveCellCount(); size_t globalFractureModelActiveCellCount(); @@ -81,7 +83,10 @@ private: std::vector m_nodes; ///< Global vertex table std::vector m_cells; ///< Global array of all cells in the reservoir (including the ones in LGR's) cvf::Collection m_localGrids; ///< List of all the LGR's in this reservoir - cvf::ref m_results; + + cvf::ref m_matrixModelResults; + cvf::ref m_fractureModelResults; + size_t m_globalMatrixModelActiveCellCount; size_t m_globalFractureModelActiveCellCount; diff --git a/ApplicationCode/ReservoirDataModel/RigReservoirCellResults.cpp b/ApplicationCode/ReservoirDataModel/RigReservoirCellResults.cpp index 5d1da652d8..c9672802e6 100644 --- a/ApplicationCode/ReservoirDataModel/RigReservoirCellResults.cpp +++ b/ApplicationCode/ReservoirDataModel/RigReservoirCellResults.cpp @@ -763,3 +763,13 @@ size_t RigReservoirCellResults::addStaticScalarResult(RimDefines::ResultCatType return resultIdx; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifReaderInterface::PorosityModelResultType RigReservoirCellResults::convertFromProjectModelPorosityModel(RimDefines::PorosityModelType porosityModel) +{ + if (porosityModel == RimDefines::MATRIX_MODEL) return RifReaderInterface::MATRIX_RESULTS; + + return RifReaderInterface::FRACTURE_RESULTS; +} + diff --git a/ApplicationCode/ReservoirDataModel/RigReservoirCellResults.h b/ApplicationCode/ReservoirDataModel/RigReservoirCellResults.h index 251a9e7da2..577f681039 100644 --- a/ApplicationCode/ReservoirDataModel/RigReservoirCellResults.h +++ b/ApplicationCode/ReservoirDataModel/RigReservoirCellResults.h @@ -22,6 +22,7 @@ #include #include #include +#include "RifReaderInterface.h" class RifReaderInterface; class RigMainGrid; @@ -73,6 +74,8 @@ public: std::vector< std::vector > & cellScalarResults(size_t scalarResultIndex); double cellScalarResult(size_t timeStepIndex, size_t scalarResultIndex, size_t resultValueIndex); + static RifReaderInterface::PorosityModelResultType convertFromProjectModelPorosityModel(RimDefines::PorosityModelType porosityModel); + private: size_t addStaticScalarResult(RimDefines::ResultCatType type, const QString& resultName, size_t resultValueCount); diff --git a/ApplicationCode/SocketInterface/RiaSocketServer.cpp b/ApplicationCode/SocketInterface/RiaSocketServer.cpp index 344e4cda22..e5de2c2e25 100644 --- a/ApplicationCode/SocketInterface/RiaSocketServer.cpp +++ b/ApplicationCode/SocketInterface/RiaSocketServer.cpp @@ -281,18 +281,18 @@ void RiaSocketServer::readCommandFromOctave() size_t scalarResultIndex = cvf::UNDEFINED_SIZE_T; std::vector< std::vector >* scalarResultFrames = NULL; - if (reservoir && reservoir->reservoirData() && reservoir->reservoirData()->mainGrid() && reservoir->reservoirData()->mainGrid()->results()) + if (reservoir && reservoir->reservoirData() && reservoir->reservoirData()->mainGrid() && reservoir->reservoirData()->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)) { - scalarResultIndex = reservoir->reservoirData()->mainGrid()->results()->findOrLoadScalarResult(propertyName); + scalarResultIndex = reservoir->reservoirData()->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(propertyName); if (scalarResultIndex == cvf::UNDEFINED_SIZE_T && isSetProperty) { - scalarResultIndex = reservoir->reservoirData()->mainGrid()->results()->addEmptyScalarResult(RimDefines::GENERATED, propertyName); + scalarResultIndex = reservoir->reservoirData()->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->addEmptyScalarResult(RimDefines::GENERATED, propertyName); } if (scalarResultIndex != cvf::UNDEFINED_SIZE_T) { - scalarResultFrames = &(reservoir->reservoirData()->mainGrid()->results()->cellScalarResults(scalarResultIndex)); + scalarResultFrames = &(reservoir->reservoirData()->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(scalarResultIndex)); m_currentScalarIndex = scalarResultIndex; m_currentPropertyName = propertyName; } @@ -518,9 +518,9 @@ void RiaSocketServer::readPropertyDataFromOctave() if( m_currentScalarIndex != cvf::UNDEFINED_SIZE_T && m_currentReservoir->reservoirData() && m_currentReservoir->reservoirData()->mainGrid() && - m_currentReservoir->reservoirData()->mainGrid()->results() ) + m_currentReservoir->reservoirData()->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS) ) { - m_currentReservoir->reservoirData()->mainGrid()->results()->recalculateMinMax(m_currentScalarIndex); + m_currentReservoir->reservoirData()->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->recalculateMinMax(m_currentScalarIndex); } for (size_t i = 0; i < m_currentReservoir->reservoirViews.size(); ++i)