mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added porosity model to ResultDefinition
Keep this property hidden from GUI until more testing is done p4#: 20339
This commit is contained in:
parent
578e3f7db3
commit
644d201b37
@ -212,11 +212,11 @@ std::map<QString, QString> RifEclipseInputFileTools::readProperties(const QStri
|
|||||||
ecl_kw_type* eclKeyWordData = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false , ECL_FLOAT_TYPE);
|
ecl_kw_type* eclKeyWordData = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false , ECL_FLOAT_TYPE);
|
||||||
if (eclKeyWordData)
|
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<double> >& newPropertyData = reservoir->mainGrid()->results()->cellScalarResults(resultIndex);
|
std::vector< std::vector<double> >& newPropertyData = reservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(resultIndex);
|
||||||
newPropertyData.push_back(std::vector<double>());
|
newPropertyData.push_back(std::vector<double>());
|
||||||
newPropertyData[0].resize(ecl_kw_get_size(eclKeyWordData), HUGE_VAL);
|
newPropertyData[0].resize(ecl_kw_get_size(eclKeyWordData), HUGE_VAL);
|
||||||
ecl_kw_get_data_as_double(eclKeyWordData, newPropertyData[0].data());
|
ecl_kw_get_data_as_double(eclKeyWordData, newPropertyData[0].data());
|
||||||
@ -294,13 +294,13 @@ bool RifEclipseInputFileTools::readProperty(const QString& fileName, RigReservoi
|
|||||||
if (eclKeyWordData)
|
if (eclKeyWordData)
|
||||||
{
|
{
|
||||||
QString newResultName = resultName;
|
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)
|
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<double> >& newPropertyData = reservoir->mainGrid()->results()->cellScalarResults(resultIndex);
|
std::vector< std::vector<double> >& newPropertyData = reservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(resultIndex);
|
||||||
newPropertyData.resize(1);
|
newPropertyData.resize(1);
|
||||||
newPropertyData[0].resize(ecl_kw_get_size(eclKeyWordData), HUGE_VAL);
|
newPropertyData[0].resize(ecl_kw_get_size(eclKeyWordData), HUGE_VAL);
|
||||||
ecl_kw_get_data_as_double(eclKeyWordData, newPropertyData[0].data());
|
ecl_kw_get_data_as_double(eclKeyWordData, newPropertyData[0].data());
|
||||||
@ -374,7 +374,7 @@ bool RifEclipseInputFileTools::writePropertyToTextFile(const QString& fileName,
|
|||||||
{
|
{
|
||||||
CVF_ASSERT(reservoir);
|
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)
|
if (resultIndex == cvf::UNDEFINED_SIZE_T)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@ -386,7 +386,7 @@ bool RifEclipseInputFileTools::writePropertyToTextFile(const QString& fileName,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector< std::vector<double> >& resultData = reservoir->mainGrid()->results()->cellScalarResults(resultIndex);
|
std::vector< std::vector<double> >& resultData = reservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(resultIndex);
|
||||||
if (resultData.size() == 0)
|
if (resultData.size() == 0)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@ -402,11 +402,11 @@ bool RifEclipseInputFileTools::writePropertyToTextFile(const QString& fileName,
|
|||||||
/// Create and write a result vector with values for all cells.
|
/// Create and write a result vector with values for all cells.
|
||||||
/// undefinedValue is used for cells with no result
|
/// 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);
|
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)
|
if (resultIndex == cvf::UNDEFINED_SIZE_T)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@ -418,7 +418,7 @@ bool RifEclipseInputFileTools::writeBinaryResultToTextFile(const QString& fileNa
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
cvf::ref<RigGridScalarDataAccess> dataAccessObject = reservoir->mainGrid()->dataAccessObject(timeStep, resultIndex);
|
cvf::ref<RigGridScalarDataAccess> dataAccessObject = reservoir->mainGrid()->dataAccessObject(porosityModel, timeStep, resultIndex);
|
||||||
if (dataAccessObject.isNull())
|
if (dataAccessObject.isNull())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@ -532,13 +532,13 @@ bool RifEclipseInputFileTools::readPropertyAtFilePosition(const QString& fileNam
|
|||||||
if (eclKeyWordData)
|
if (eclKeyWordData)
|
||||||
{
|
{
|
||||||
QString newResultName = resultName;
|
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)
|
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<double> >& newPropertyData = reservoir->mainGrid()->results()->cellScalarResults(resultIndex);
|
std::vector< std::vector<double> >& newPropertyData = reservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(resultIndex);
|
||||||
newPropertyData.resize(1);
|
newPropertyData.resize(1);
|
||||||
newPropertyData[0].resize(ecl_kw_get_size(eclKeyWordData), HUGE_VAL);
|
newPropertyData[0].resize(ecl_kw_get_size(eclKeyWordData), HUGE_VAL);
|
||||||
ecl_kw_get_data_as_double(eclKeyWordData, newPropertyData[0].data());
|
ecl_kw_get_data_as_double(eclKeyWordData, newPropertyData[0].data());
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include "RifReaderInterface.h"
|
||||||
|
|
||||||
|
|
||||||
class RigReservoir;
|
class RigReservoir;
|
||||||
@ -63,7 +64,7 @@ public:
|
|||||||
static const std::vector<QString>& knownPropertyKeywords();
|
static const std::vector<QString>& knownPropertyKeywords();
|
||||||
|
|
||||||
static bool writePropertyToTextFile(const QString& fileName, RigReservoir* reservoir, size_t timeStep, const QString& resultName, const QString& eclipseKeyWord);
|
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:
|
private:
|
||||||
static void writeDataToTextFile(QFile* file, const QString& eclipseKeyWord, const std::vector<double>& resultData);
|
static void writeDataToTextFile(QFile* file, const QString& eclipseKeyWord, const std::vector<double>& resultData);
|
||||||
|
@ -49,7 +49,7 @@ public:
|
|||||||
virtual QStringList timeStepsText() = 0;
|
virtual QStringList timeStepsText() = 0;
|
||||||
virtual QList<QDateTime> timeSteps() = 0;
|
virtual QList<QDateTime> 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<double>* values) = 0;
|
virtual bool results(const QString& resultName, RifReaderInterface::PorosityModelResultType matrixOrFracture, size_t timeStep, std::vector<double>* values) = 0;
|
||||||
|
|
||||||
virtual void readWellData(well_info_type * well_info) = 0;
|
virtual void readWellData(well_info_type * well_info) = 0;
|
||||||
|
@ -127,13 +127,13 @@ QList<QDateTime> RifEclipseRestartFilesetAccess::timeSteps()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
/// Get list of result names
|
/// Get list of result names
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QStringList RifEclipseRestartFilesetAccess::resultNames()
|
QStringList RifEclipseRestartFilesetAccess::resultNames(RifReaderInterface::PorosityModelResultType matrixOrFracture)
|
||||||
{
|
{
|
||||||
CVF_ASSERT(numTimeSteps() > 0);
|
CVF_ASSERT(numTimeSteps() > 0);
|
||||||
|
|
||||||
// Get the results found on the first file
|
// Get the results found on the first file
|
||||||
QStringList resultsList;
|
QStringList resultsList;
|
||||||
m_files[0]->validKeywords(&resultsList, RifReaderInterface::MATRIX_RESULTS);
|
m_files[0]->validKeywords(&resultsList, matrixOrFracture);
|
||||||
|
|
||||||
return resultsList;
|
return resultsList;
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ public:
|
|||||||
QStringList timeStepsText();
|
QStringList timeStepsText();
|
||||||
QList<QDateTime> timeSteps();
|
QList<QDateTime> timeSteps();
|
||||||
|
|
||||||
QStringList resultNames();
|
QStringList resultNames(RifReaderInterface::PorosityModelResultType matrixOrFracture);
|
||||||
bool results(const QString& resultName, RifReaderInterface::PorosityModelResultType matrixOrFracture, size_t timeStep, std::vector<double>* values);
|
bool results(const QString& resultName, RifReaderInterface::PorosityModelResultType matrixOrFracture, size_t timeStep, std::vector<double>* values);
|
||||||
|
|
||||||
virtual void readWellData(well_info_type* well_info);
|
virtual void readWellData(well_info_type* well_info);
|
||||||
|
@ -113,11 +113,11 @@ QList<QDateTime> RifEclipseUnifiedRestartFileAccess::timeSteps()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
/// Get list of result names
|
/// Get list of result names
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QStringList RifEclipseUnifiedRestartFileAccess::resultNames()
|
QStringList RifEclipseUnifiedRestartFileAccess::resultNames(RifReaderInterface::PorosityModelResultType matrixOrFracture)
|
||||||
{
|
{
|
||||||
// Get the results found on the UNRST file
|
// Get the results found on the UNRST file
|
||||||
QStringList resultsList;
|
QStringList resultsList;
|
||||||
m_file->validKeywords(&resultsList, RifReaderInterface::MATRIX_RESULTS);
|
m_file->validKeywords(&resultsList, matrixOrFracture);
|
||||||
|
|
||||||
return resultsList;
|
return resultsList;
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ public:
|
|||||||
QStringList timeStepsText();
|
QStringList timeStepsText();
|
||||||
QList<QDateTime> timeSteps();
|
QList<QDateTime> timeSteps();
|
||||||
|
|
||||||
QStringList resultNames();
|
QStringList resultNames(RifReaderInterface::PorosityModelResultType matrixOrFracture);
|
||||||
bool results(const QString& resultName, RifReaderInterface::PorosityModelResultType matrixOrFracture, size_t timeStep, std::vector<double>* values);
|
bool results(const QString& resultName, RifReaderInterface::PorosityModelResultType matrixOrFracture, size_t timeStep, std::vector<double>* values);
|
||||||
|
|
||||||
virtual void readWellData(well_info_type * well_info);
|
virtual void readWellData(well_info_type * well_info);
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "RifEclipseOutputFileTools.h"
|
#include "RifEclipseOutputFileTools.h"
|
||||||
#include "RifEclipseUnifiedRestartFileAccess.h"
|
#include "RifEclipseUnifiedRestartFileAccess.h"
|
||||||
#include "RifEclipseRestartFilesetAccess.h"
|
#include "RifEclipseRestartFilesetAccess.h"
|
||||||
|
#include "RifReaderInterface.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
@ -370,21 +371,34 @@ bool RifReaderEclipseOutput::buildMetaData(RigReservoir* reservoir)
|
|||||||
return false;
|
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())
|
if (m_dynamicResultsAccess.notNull())
|
||||||
{
|
{
|
||||||
// Get time steps
|
// Get time steps
|
||||||
m_timeSteps = m_dynamicResultsAccess->timeSteps();
|
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]);
|
QStringList dynamicResultNames = m_dynamicResultsAccess->resultNames(RifReaderInterface::MATRIX_RESULTS);
|
||||||
resCellResults->setTimeStepDates(resIndex, m_timeSteps);
|
|
||||||
|
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);
|
progInfo.setProgress(1);
|
||||||
@ -399,21 +413,40 @@ bool RifReaderEclipseOutput::buildMetaData(RigReservoir* reservoir)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the names of the static results
|
|
||||||
QStringList staticResults;
|
|
||||||
initFile->validKeywords(&staticResults, RifReaderInterface::MATRIX_RESULTS);
|
|
||||||
QStringList staticResultNames = staticResults;
|
|
||||||
|
|
||||||
QList<QDateTime> staticDate;
|
|
||||||
if (m_timeSteps.size() > 0)
|
|
||||||
{
|
{
|
||||||
staticDate.push_back(m_timeSteps.front());
|
QStringList staticResults;
|
||||||
|
initFile->validKeywords(&staticResults, RifReaderInterface::MATRIX_RESULTS);
|
||||||
|
QStringList staticResultNames = staticResults;
|
||||||
|
|
||||||
|
QList<QDateTime> 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]);
|
QStringList staticResults;
|
||||||
resCellResults->setTimeStepDates(resIndex, staticDate);
|
initFile->validKeywords(&staticResults, RifReaderInterface::FRACTURE_RESULTS);
|
||||||
|
QStringList staticResultNames = staticResults;
|
||||||
|
|
||||||
|
QList<QDateTime> 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;
|
m_staticResultsAccess = initFile;
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "RifReaderMockModel.h"
|
#include "RifReaderMockModel.h"
|
||||||
#include "RigReservoirCellResults.h"
|
#include "RigReservoirCellResults.h"
|
||||||
|
#include "RifReaderInterface.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
@ -30,7 +31,7 @@ bool RifReaderMockModel::open(const QString& fileName, RigReservoir* reservoir)
|
|||||||
|
|
||||||
m_reservoir = reservoir;
|
m_reservoir = reservoir;
|
||||||
|
|
||||||
RigReservoirCellResults* cellResults = reservoir->mainGrid()->results();
|
RigReservoirCellResults* cellResults = reservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS);
|
||||||
|
|
||||||
|
|
||||||
QList<QDateTime> dates;
|
QList<QDateTime> dates;
|
||||||
|
@ -101,7 +101,8 @@ void RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo(
|
|||||||
timeStepIndex = 0;
|
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];
|
size_t resultIndices[6];
|
||||||
@ -114,7 +115,7 @@ void RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo(
|
|||||||
{
|
{
|
||||||
if (resultIndices[cubeFaceIdx] != cvf::UNDEFINED_SIZE_T)
|
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)
|
if (scalarValue != HUGE_VAL)
|
||||||
{
|
{
|
||||||
cellColorTextureCoord = cellResultScalarMapper->mapToTextureCoord(scalarValue)[0];
|
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
|
// 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)
|
if (scalarValue != HUGE_VAL && scalarValue != ignoredScalarValue)
|
||||||
{
|
{
|
||||||
edgeColor = edgeResultScalarMapper->mapToTextureCoord(scalarValue)[0];
|
edgeColor = edgeResultScalarMapper->mapToTextureCoord(scalarValue)[0];
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "RimResultSlot.h"
|
#include "RimResultSlot.h"
|
||||||
#include "RimCellEdgeResultSlot.h"
|
#include "RimCellEdgeResultSlot.h"
|
||||||
#include "RigGridScalarDataAccess.h"
|
#include "RigGridScalarDataAccess.h"
|
||||||
|
#include "RigReservoirCellResults.h"
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -219,7 +220,8 @@ void RivGridPartMgr::updateCellResultColor(size_t timeStepIndex, RimResultSlot*
|
|||||||
size_t resTimeStepIdx = timeStepIndex;
|
size_t resTimeStepIdx = timeStepIndex;
|
||||||
if (cellResultSlot->hasStaticResult()) resTimeStepIdx = 0;
|
if (cellResultSlot->hasStaticResult()) resTimeStepIdx = 0;
|
||||||
|
|
||||||
cvf::ref<RigGridScalarDataAccess> dataAccessObject = m_grid->dataAccessObject(timeStepIndex, scalarSetIndex);
|
RifReaderInterface::PorosityModelResultType porosityModel = RigReservoirCellResults::convertFromProjectModelPorosityModel(cellResultSlot->porosityModel());
|
||||||
|
cvf::ref<RigGridScalarDataAccess> dataAccessObject = m_grid->dataAccessObject(porosityModel, timeStepIndex, scalarSetIndex);
|
||||||
if (dataAccessObject.isNull()) return;
|
if (dataAccessObject.isNull()) return;
|
||||||
|
|
||||||
// Outer surface
|
// Outer surface
|
||||||
|
@ -599,7 +599,8 @@ void RivReservoirViewPartMgr::computePropertyVisibility(cvf::UByteArray* cellVis
|
|||||||
|
|
||||||
const RimCellFilter::FilterModeType filterType = (*pfIt)->filterMode();
|
const RimCellFilter::FilterModeType filterType = (*pfIt)->filterMode();
|
||||||
|
|
||||||
cvf::ref<RigGridScalarDataAccess> dataAccessObject = grid->dataAccessObject(timeStepIndex, scalarResultIndex);
|
RifReaderInterface::PorosityModelResultType porosityModel = RigReservoirCellResults::convertFromProjectModelPorosityModel((*pfIt)->resultDefinition()->porosityModel());
|
||||||
|
cvf::ref<RigGridScalarDataAccess> dataAccessObject = grid->dataAccessObject(porosityModel, timeStepIndex, scalarResultIndex);
|
||||||
CVF_ASSERT(dataAccessObject.notNull());
|
CVF_ASSERT(dataAccessObject.notNull());
|
||||||
|
|
||||||
#pragma omp parallel for schedule(dynamic)
|
#pragma omp parallel for schedule(dynamic)
|
||||||
|
@ -34,5 +34,15 @@ namespace caf
|
|||||||
|
|
||||||
setDefault(RimDefines::DYNAMIC_NATIVE);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +33,12 @@ public:
|
|||||||
REMOVED
|
REMOVED
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum PorosityModelType
|
||||||
|
{
|
||||||
|
MATRIX_MODEL,
|
||||||
|
FRACTURE_MODEL
|
||||||
|
};
|
||||||
|
|
||||||
static QString undefinedResultName() { return "None"; }
|
static QString undefinedResultName() { return "None"; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -72,7 +72,8 @@ void RimInputReservoir::openDataFileSet(const QStringList& filenames)
|
|||||||
if (caseName().contains("Input Mock Debug Model"))
|
if (caseName().contains("Input Mock Debug Model"))
|
||||||
{
|
{
|
||||||
cvf::ref<RifReaderInterface> readerInterface = this->createMockModel(this->caseName());
|
cvf::ref<RifReaderInterface> 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,16 +180,21 @@ bool RimInputReservoir::openEclipseGridFile()
|
|||||||
CVF_ASSERT(m_rigReservoir.notNull());
|
CVF_ASSERT(m_rigReservoir.notNull());
|
||||||
CVF_ASSERT(readerInterface.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->computeFaults();
|
||||||
m_rigReservoir->mainGrid()->computeCachedData();
|
m_rigReservoir->mainGrid()->computeCachedData();
|
||||||
}
|
}
|
||||||
|
|
||||||
RigReservoirCellResults* results = m_rigReservoir->mainGrid()->results();
|
|
||||||
RIApplication* app = RIApplication::instance();
|
RIApplication* app = RIApplication::instance();
|
||||||
if (app->preferences()->autocomputeDepthRelatedProperties)
|
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;
|
return true;
|
||||||
@ -277,7 +283,7 @@ void RimInputReservoir::loadAndSyncronizeInputProperties()
|
|||||||
{
|
{
|
||||||
if (fileKeywordSet.count(knownKeywords[fkIt]))
|
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))
|
if (RifEclipseInputFileTools::readProperty(filenames[i], this->reservoirData(), knownKeywords[fkIt], resultName))
|
||||||
{
|
{
|
||||||
RimInputProperty* inputProperty = new RimInputProperty;
|
RimInputProperty* inputProperty = new RimInputProperty;
|
||||||
@ -352,7 +358,7 @@ void RimInputReservoir::removeProperty(RimInputProperty* inputProperty)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove the results pointed to by this input property
|
// 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);
|
results->removeResult(inputProperty->resultName);
|
||||||
|
|
||||||
this->removeResult(inputProperty->resultName);
|
this->removeResult(inputProperty->resultName);
|
||||||
|
@ -209,10 +209,16 @@ void RimReservoir::fieldChangedByUi(const caf::PdmFieldHandle* changedField, con
|
|||||||
reservoirView->createDisplayModelAndRedraw();
|
reservoirView->createDisplayModelAndRedraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
RigReservoirCellResults* results = m_rigReservoir->mainGrid()->results();
|
RigReservoirCellResults* matrixModelResults = m_rigReservoir->mainGrid()->results(RifReaderInterface::MATRIX_RESULTS);
|
||||||
if (results)
|
if (matrixModelResults)
|
||||||
{
|
{
|
||||||
results->clearAllResults();
|
matrixModelResults->clearAllResults();
|
||||||
|
}
|
||||||
|
|
||||||
|
RigReservoirCellResults* fractureModelResults = m_rigReservoir->mainGrid()->results(RifReaderInterface::FRACTURE_RESULTS);
|
||||||
|
if (fractureModelResults)
|
||||||
|
{
|
||||||
|
fractureModelResults->clearAllResults();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -683,12 +683,11 @@ void RimReservoirView::loadDataAndUpdate()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RigReservoirCellResults* results = gridCellResults();
|
|
||||||
CVF_ASSERT(results);
|
|
||||||
|
|
||||||
RIApplication* app = RIApplication::instance();
|
RIApplication* app = RIApplication::instance();
|
||||||
if (app->preferences()->autocomputeSOIL)
|
if (app->preferences()->autocomputeSOIL)
|
||||||
{
|
{
|
||||||
|
RigReservoirCellResults* results = gridCellResults();
|
||||||
|
CVF_ASSERT(results);
|
||||||
results->loadOrComputeSOIL();
|
results->loadOrComputeSOIL();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -851,7 +850,8 @@ void RimReservoirView::appendCellResultInfo(size_t gridIndex, size_t cellIndex,
|
|||||||
const RigGridBase* grid = reservoir->grid(gridIndex);
|
const RigGridBase* grid = reservoir->grid(gridIndex);
|
||||||
if (this->cellResult()->hasResult())
|
if (this->cellResult()->hasResult())
|
||||||
{
|
{
|
||||||
cvf::ref<RigGridScalarDataAccess> dataAccessObject = grid->dataAccessObject(m_currentTimeStep, this->cellResult()->gridScalarIndex());
|
RifReaderInterface::PorosityModelResultType porosityModel = RigReservoirCellResults::convertFromProjectModelPorosityModel(cellResult()->porosityModel());
|
||||||
|
cvf::ref<RigGridScalarDataAccess> dataAccessObject = grid->dataAccessObject(porosityModel, m_currentTimeStep, this->cellResult()->gridScalarIndex());
|
||||||
if (dataAccessObject.notNull())
|
if (dataAccessObject.notNull())
|
||||||
{
|
{
|
||||||
double scalarValue = dataAccessObject->cellScalar(cellIndex);
|
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;
|
if (resultIndices[idx] == cvf::UNDEFINED_SIZE_T) continue;
|
||||||
|
|
||||||
// Cell edge results are static, results are loaded for first time step only
|
// Cell edge results are static, results are loaded for first time step only
|
||||||
cvf::ref<RigGridScalarDataAccess> dataAccessObject = grid->dataAccessObject(0, resultIndices[idx]);
|
RifReaderInterface::PorosityModelResultType porosityModel = RigReservoirCellResults::convertFromProjectModelPorosityModel(cellResult()->porosityModel());
|
||||||
|
cvf::ref<RigGridScalarDataAccess> dataAccessObject = grid->dataAccessObject(porosityModel, 0, resultIndices[idx]);
|
||||||
if (dataAccessObject.notNull())
|
if (dataAccessObject.notNull())
|
||||||
{
|
{
|
||||||
double scalarValue = dataAccessObject->cellScalar(cellIndex);
|
double scalarValue = dataAccessObject->cellScalar(cellIndex);
|
||||||
@ -940,7 +941,9 @@ RigReservoirCellResults* RimReservoirView::gridCellResults()
|
|||||||
m_reservoir->reservoirData()->mainGrid()
|
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;
|
return NULL;
|
||||||
@ -1009,7 +1012,8 @@ void RimReservoirView::updateLegends()
|
|||||||
RigReservoir* reservoir = m_reservoir->reservoirData();
|
RigReservoir* reservoir = m_reservoir->reservoirData();
|
||||||
CVF_ASSERT(reservoir);
|
CVF_ASSERT(reservoir);
|
||||||
|
|
||||||
RigReservoirCellResults* results = reservoir->mainGrid()->results();
|
RifReaderInterface::PorosityModelResultType porosityModel = RigReservoirCellResults::convertFromProjectModelPorosityModel(cellResult()->porosityModel());
|
||||||
|
RigReservoirCellResults* results = reservoir->mainGrid()->results(porosityModel);
|
||||||
CVF_ASSERT(results);
|
CVF_ASSERT(results);
|
||||||
|
|
||||||
if (this->cellResult()->hasResult())
|
if (this->cellResult()->hasResult())
|
||||||
|
@ -38,10 +38,12 @@ RimResultDefinition::RimResultDefinition()
|
|||||||
{
|
{
|
||||||
CAF_PDM_InitObject("Result Definition", "", "", "");
|
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", "", "", "" );
|
CAF_PDM_InitField(&resultVariable, "ResultVariable", RimDefines::undefinedResultName(), "Variable", "", "", "" );
|
||||||
|
|
||||||
resultVariable.setUiEditorTypeName(caf::PdmUiListEditor::uiEditorTypeName());
|
resultVariable.setUiEditorTypeName(caf::PdmUiListEditor::uiEditorTypeName());
|
||||||
|
porosityModel.setUiHidden(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -82,35 +84,6 @@ QList<caf::PdmOptionItemInfo> RimResultDefinition::calculateValueOptions(const c
|
|||||||
{
|
{
|
||||||
if (m_reservoirView && m_reservoirView->gridCellResults())
|
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());
|
QStringList varList = m_reservoirView->gridCellResults()->resultNames(resultType());
|
||||||
QList<caf::PdmOptionItemInfo> optionList;
|
QList<caf::PdmOptionItemInfo> optionList;
|
||||||
int i;
|
int i;
|
||||||
@ -134,7 +107,7 @@ QList<caf::PdmOptionItemInfo> RimResultDefinition::calculateValueOptions(const c
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
size_t RimResultDefinition::gridScalarIndex() const
|
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();
|
const RigReservoirCellResults* gridCellResults = m_reservoirView->gridCellResults();
|
||||||
if (gridCellResults) m_gridScalarResultIndex = gridCellResults->findScalarResultIndex(resultType(), resultVariable());
|
if (gridCellResults) m_gridScalarResultIndex = gridCellResults->findScalarResultIndex(resultType(), resultVariable());
|
||||||
|
@ -42,8 +42,9 @@ public:
|
|||||||
virtual void setReservoirView(RimReservoirView* ownerReservoirView);
|
virtual void setReservoirView(RimReservoirView* ownerReservoirView);
|
||||||
RimReservoirView* reservoirView();
|
RimReservoirView* reservoirView();
|
||||||
|
|
||||||
caf::PdmField< caf::AppEnum< RimDefines::ResultCatType > > resultType;
|
caf::PdmField< caf::AppEnum< RimDefines::ResultCatType > > resultType;
|
||||||
caf::PdmField<QString> resultVariable;
|
caf::PdmField< caf::AppEnum< RimDefines::PorosityModelType > > porosityModel;
|
||||||
|
caf::PdmField<QString> resultVariable;
|
||||||
|
|
||||||
void loadResult();
|
void loadResult();
|
||||||
size_t gridScalarIndex() const;
|
size_t gridScalarIndex() const;
|
||||||
|
@ -89,7 +89,8 @@ bool RimResultReservoir::openEclipseGridFile()
|
|||||||
CVF_ASSERT(m_rigReservoir.notNull());
|
CVF_ASSERT(m_rigReservoir.notNull());
|
||||||
CVF_ASSERT(readerInterface.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");
|
progInfo.setProgressDescription("Computing Faults");
|
||||||
m_rigReservoir->computeFaults();
|
m_rigReservoir->computeFaults();
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include "RifEclipseInputFileTools.h"
|
#include "RifEclipseInputFileTools.h"
|
||||||
#include "RimInputReservoir.h"
|
#include "RimInputReservoir.h"
|
||||||
#include "RimBinaryExportSettings.h"
|
#include "RimBinaryExportSettings.h"
|
||||||
|
#include "RigReservoirCellResults.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
@ -727,7 +728,9 @@ void RimUiTreeView::slotWriteBinaryResultAsInputProperty()
|
|||||||
if (preferencesDialog.exec() == QDialog::Accepted)
|
if (preferencesDialog.exec() == QDialog::Accepted)
|
||||||
{
|
{
|
||||||
size_t timeStep = resultSlot->reservoirView()->currentTimeStep();
|
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)
|
if (!isOk)
|
||||||
{
|
{
|
||||||
QMessageBox::critical(NULL, "File export", "Failed to exported current result to " + exportSettings.fileName);
|
QMessageBox::critical(NULL, "File export", "Failed to exported current result to " + exportSettings.fileName);
|
||||||
|
@ -525,12 +525,12 @@ void RigGridBase::computeMatrixAndFractureModelActiveCellCount()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
cvf::ref<RigGridScalarDataAccess> RigGridBase::dataAccessObject(size_t timeStepIndex, size_t scalarSetIndex) const
|
cvf::ref<RigGridScalarDataAccess> RigGridBase::dataAccessObject(RifReaderInterface::PorosityModelResultType porosityModel, size_t timeStepIndex, size_t scalarSetIndex) const
|
||||||
{
|
{
|
||||||
if (timeStepIndex != cvf::UNDEFINED_SIZE_T &&
|
if (timeStepIndex != cvf::UNDEFINED_SIZE_T &&
|
||||||
scalarSetIndex != cvf::UNDEFINED_SIZE_T)
|
scalarSetIndex != cvf::UNDEFINED_SIZE_T)
|
||||||
{
|
{
|
||||||
cvf::ref<RigGridScalarDataAccess> dataAccess = new RigGridScalarDataAccess(this, timeStepIndex, scalarSetIndex);
|
cvf::ref<RigGridScalarDataAccess> dataAccess = new RigGridScalarDataAccess(this, porosityModel, timeStepIndex, scalarSetIndex);
|
||||||
return dataAccess;
|
return dataAccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "cvfStructGridScalarDataAccess.h"
|
#include "cvfStructGridScalarDataAccess.h"
|
||||||
|
#include "RifReaderInterface.h"
|
||||||
|
|
||||||
|
|
||||||
class RigMainGrid;
|
class RigMainGrid;
|
||||||
@ -95,7 +96,7 @@ public:
|
|||||||
virtual bool isCellValid( size_t i, size_t j, size_t k ) const;
|
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;
|
virtual bool cellIJKNeighbor(size_t i, size_t j, size_t k, FaceType face, size_t* neighborCellIndex ) const;
|
||||||
|
|
||||||
cvf::ref<RigGridScalarDataAccess> dataAccessObject(size_t timeStepIndex, size_t scalarSetIndex) const;
|
cvf::ref<RigGridScalarDataAccess> dataAccessObject(RifReaderInterface::PorosityModelResultType porosityModel, size_t timeStepIndex, size_t scalarSetIndex) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string m_gridName;
|
std::string m_gridName;
|
||||||
|
@ -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);
|
||||||
CVF_ASSERT(grid->mainGrid());
|
CVF_ASSERT(grid->mainGrid());
|
||||||
CVF_ASSERT(grid->mainGrid()->results());
|
CVF_ASSERT(grid->mainGrid()->results(porosityModel));
|
||||||
|
|
||||||
m_grid = grid;
|
m_grid = grid;
|
||||||
|
|
||||||
m_useGlobalActiveIndex = m_grid->mainGrid()->results()->isUsingGlobalActiveIndex(scalarSetIndex);
|
m_useGlobalActiveIndex = m_grid->mainGrid()->results(porosityModel)->isUsingGlobalActiveIndex(scalarSetIndex);
|
||||||
|
|
||||||
std::vector< std::vector<double> > & scalarSetResults = m_grid->mainGrid()->results()->cellScalarResults(scalarSetIndex);
|
std::vector< std::vector<double> > & scalarSetResults = m_grid->mainGrid()->results(porosityModel)->cellScalarResults(scalarSetIndex);
|
||||||
CVF_ASSERT(timeStepIndex < scalarSetResults.size());
|
CVF_ASSERT(timeStepIndex < scalarSetResults.size());
|
||||||
|
|
||||||
m_resultValues = &(scalarSetResults[timeStepIndex]);
|
m_resultValues = &(scalarSetResults[timeStepIndex]);
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include "cvfStructGridScalarDataAccess.h"
|
#include "cvfStructGridScalarDataAccess.h"
|
||||||
#include "RigGridBase.h"
|
#include "RigGridBase.h"
|
||||||
|
#include "RifReaderInterface.h"
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -29,7 +30,7 @@
|
|||||||
class RigGridScalarDataAccess : public cvf::StructGridScalarDataAccess
|
class RigGridScalarDataAccess : public cvf::StructGridScalarDataAccess
|
||||||
{
|
{
|
||||||
public:
|
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 i, size_t j, size_t k) const;
|
||||||
virtual double cellScalar(size_t cellIndex) const;
|
virtual double cellScalar(size_t cellIndex) const;
|
||||||
|
@ -32,7 +32,8 @@ RigMainGrid::RigMainGrid(void)
|
|||||||
m_globalMatrixModelActiveCellCount(cvf::UNDEFINED_SIZE_T),
|
m_globalMatrixModelActiveCellCount(cvf::UNDEFINED_SIZE_T),
|
||||||
m_globalFractureModelActiveCellCount(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_activeCellsBoundingBox.add(cvf::Vec3d::ZERO);
|
||||||
m_gridIndex = 0;
|
m_gridIndex = 0;
|
||||||
@ -374,3 +375,29 @@ void RigMainGrid::computeGlobalActiveCellCount()
|
|||||||
if (m_cells[i].isActiveInFractureModel()) m_globalFractureModelActiveCellCount++;
|
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();
|
||||||
|
}
|
||||||
|
@ -23,11 +23,13 @@
|
|||||||
#include "RigLocalGrid.h"
|
#include "RigLocalGrid.h"
|
||||||
#include "cvfCollection.h"
|
#include "cvfCollection.h"
|
||||||
#include "cvfBoundingBox.h"
|
#include "cvfBoundingBox.h"
|
||||||
|
#include "RifReaderInterface.h"
|
||||||
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
class RigReservoirCellResults;
|
class RigReservoirCellResults;
|
||||||
|
|
||||||
class RigMainGrid : public RigGridBase
|
class RigMainGrid : public RigGridBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RigMainGrid();
|
RigMainGrid();
|
||||||
@ -40,8 +42,8 @@ public:
|
|||||||
std::vector<RigCell>& cells() {return m_cells;}
|
std::vector<RigCell>& cells() {return m_cells;}
|
||||||
const std::vector<RigCell>& cells() const {return m_cells;}
|
const std::vector<RigCell>& cells() const {return m_cells;}
|
||||||
|
|
||||||
RigReservoirCellResults* results() {return m_results.p();}
|
RigReservoirCellResults* results(RifReaderInterface::PorosityModelResultType porosityModel);
|
||||||
const RigReservoirCellResults* results() const {return m_results.p();}
|
const RigReservoirCellResults* results(RifReaderInterface::PorosityModelResultType porosityModel) const;
|
||||||
|
|
||||||
size_t globalMatrixModelActiveCellCount();
|
size_t globalMatrixModelActiveCellCount();
|
||||||
size_t globalFractureModelActiveCellCount();
|
size_t globalFractureModelActiveCellCount();
|
||||||
@ -81,7 +83,10 @@ private:
|
|||||||
std::vector<cvf::Vec3d> m_nodes; ///< Global vertex table
|
std::vector<cvf::Vec3d> m_nodes; ///< Global vertex table
|
||||||
std::vector<RigCell> m_cells; ///< Global array of all cells in the reservoir (including the ones in LGR's)
|
std::vector<RigCell> m_cells; ///< Global array of all cells in the reservoir (including the ones in LGR's)
|
||||||
cvf::Collection<RigLocalGrid> m_localGrids; ///< List of all the LGR's in this reservoir
|
cvf::Collection<RigLocalGrid> m_localGrids; ///< List of all the LGR's in this reservoir
|
||||||
cvf::ref<RigReservoirCellResults> m_results;
|
|
||||||
|
cvf::ref<RigReservoirCellResults> m_matrixModelResults;
|
||||||
|
cvf::ref<RigReservoirCellResults> m_fractureModelResults;
|
||||||
|
|
||||||
size_t m_globalMatrixModelActiveCellCount;
|
size_t m_globalMatrixModelActiveCellCount;
|
||||||
size_t m_globalFractureModelActiveCellCount;
|
size_t m_globalFractureModelActiveCellCount;
|
||||||
|
|
||||||
|
@ -763,3 +763,13 @@ size_t RigReservoirCellResults::addStaticScalarResult(RimDefines::ResultCatType
|
|||||||
return resultIdx;
|
return resultIdx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RifReaderInterface::PorosityModelResultType RigReservoirCellResults::convertFromProjectModelPorosityModel(RimDefines::PorosityModelType porosityModel)
|
||||||
|
{
|
||||||
|
if (porosityModel == RimDefines::MATRIX_MODEL) return RifReaderInterface::MATRIX_RESULTS;
|
||||||
|
|
||||||
|
return RifReaderInterface::FRACTURE_RESULTS;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include "RifReaderInterface.h"
|
||||||
|
|
||||||
class RifReaderInterface;
|
class RifReaderInterface;
|
||||||
class RigMainGrid;
|
class RigMainGrid;
|
||||||
@ -73,6 +74,8 @@ public:
|
|||||||
std::vector< std::vector<double> > & cellScalarResults(size_t scalarResultIndex);
|
std::vector< std::vector<double> > & cellScalarResults(size_t scalarResultIndex);
|
||||||
double cellScalarResult(size_t timeStepIndex, size_t scalarResultIndex, size_t resultValueIndex);
|
double cellScalarResult(size_t timeStepIndex, size_t scalarResultIndex, size_t resultValueIndex);
|
||||||
|
|
||||||
|
static RifReaderInterface::PorosityModelResultType convertFromProjectModelPorosityModel(RimDefines::PorosityModelType porosityModel);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
size_t addStaticScalarResult(RimDefines::ResultCatType type, const QString& resultName, size_t resultValueCount);
|
size_t addStaticScalarResult(RimDefines::ResultCatType type, const QString& resultName, size_t resultValueCount);
|
||||||
|
|
||||||
|
@ -281,18 +281,18 @@ void RiaSocketServer::readCommandFromOctave()
|
|||||||
size_t scalarResultIndex = cvf::UNDEFINED_SIZE_T;
|
size_t scalarResultIndex = cvf::UNDEFINED_SIZE_T;
|
||||||
std::vector< std::vector<double> >* scalarResultFrames = NULL;
|
std::vector< std::vector<double> >* 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)
|
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)
|
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_currentScalarIndex = scalarResultIndex;
|
||||||
m_currentPropertyName = propertyName;
|
m_currentPropertyName = propertyName;
|
||||||
}
|
}
|
||||||
@ -518,9 +518,9 @@ void RiaSocketServer::readPropertyDataFromOctave()
|
|||||||
if( m_currentScalarIndex != cvf::UNDEFINED_SIZE_T &&
|
if( m_currentScalarIndex != cvf::UNDEFINED_SIZE_T &&
|
||||||
m_currentReservoir->reservoirData() &&
|
m_currentReservoir->reservoirData() &&
|
||||||
m_currentReservoir->reservoirData()->mainGrid() &&
|
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)
|
for (size_t i = 0; i < m_currentReservoir->reservoirViews.size(); ++i)
|
||||||
|
Loading…
Reference in New Issue
Block a user