Result Storage: Finally things have come together, and seems to behave.

Refactored the loadProject system to make loading of statistical cases work as they should.
Got the update of references regarding grid and unionActive cells work
Introduced a bool to keep track of what cell results to store.
Introduced a clear method in ActiveCellInfo.
Renamed a bit
p4#: 21036
This commit is contained in:
Jacob Støren
2013-03-21 15:31:47 +01:00
parent d0d96ba145
commit 326cd79754
20 changed files with 334 additions and 155 deletions
@@ -37,7 +37,7 @@ void RigStatistics::addNamedResult(RigReservoirCellResults* destinationCellResul
std::vector<QDateTime> sourceTimeStepDates = m_sourceCases[0]->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->timeStepDates(0);
size_t destinationScalarResultIndex = destinationCellResults->addEmptyScalarResult(resultType, resultName);
size_t destinationScalarResultIndex = destinationCellResults->addEmptyScalarResult(resultType, resultName, true);
CVF_ASSERT(destinationScalarResultIndex != cvf::UNDEFINED_SIZE_T);
destinationCellResults->setTimeStepDates(destinationScalarResultIndex, sourceTimeStepDates);
@@ -76,7 +76,7 @@ void RigStatistics::buildSourceMetaData(RimDefines::ResultCatType resultType, co
size_t scalarResultIndex = matrixResults->findOrLoadScalarResult(resultType, resultName);
if (scalarResultIndex == cvf::UNDEFINED_SIZE_T)
{
size_t scalarResultIndex = matrixResults->cellResults()->addEmptyScalarResult(resultType, resultName);
size_t scalarResultIndex = matrixResults->cellResults()->addEmptyScalarResult(resultType, resultName, false);
matrixResults->cellResults()->setTimeStepDates(scalarResultIndex, timeStepDates);
std::vector< std::vector<double> >& dataValues = matrixResults->cellResults()->cellScalarResults(scalarResultIndex);
@@ -51,7 +51,8 @@ RimIdenticalGridCaseGroup::RimIdenticalGridCaseGroup()
m_mainGrid = NULL;
clearActiveCellUnions();
m_unionOfMatrixActiveCells = new RigActiveCellInfo;
m_unionOfFractureActiveCells = new RigActiveCellInfo;
}
//--------------------------------------------------------------------------------------------------
@@ -136,51 +137,50 @@ caf::PdmFieldHandle* RimIdenticalGridCaseGroup::userDescriptionField()
//--------------------------------------------------------------------------------------------------
/// Make sure changes in this functions is validated to RIApplication::addEclipseCases()
//--------------------------------------------------------------------------------------------------
void RimIdenticalGridCaseGroup::initAfterRead()
void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo()
{
if (caseCollection()->reservoirs().size() == 0)
{
return;
}
// First file is read completely including grid.
// The main grid from the first case is reused directly in for the other cases.
// Read the main case completely including grid.
// The mainGrid from the first case is reused directly in for the other cases.
// When reading active cell info, only the total cell count is tested for consistency
RigEclipseCase* mainEclipseCase = NULL;
RimResultReservoir* rimReservoir = dynamic_cast<RimResultReservoir*>(caseCollection()->reservoirs()[0]);
CVF_ASSERT(rimReservoir);
rimReservoir->openEclipseGridFile();
mainEclipseCase = rimReservoir->reservoirData();
RimReservoir* mainCase = caseCollection()->reservoirs[0];
mainCase->openEclipseGridFile();
RigEclipseCase* mainEclipseCase = mainCase->reservoirData();
CVF_ASSERT(mainEclipseCase);
// Read active cell info from all source cases
caf::ProgressInfo info(caseCollection()->reservoirs().size(), "Case group - Reading Active Cell data");
for (size_t i = 1; i < caseCollection()->reservoirs().size(); i++)
caf::ProgressInfo info(caseCollection()->reservoirs.size(), "Case group - Reading Active Cell data");
for (size_t i = 1; i < caseCollection()->reservoirs.size(); i++)
{
RimResultReservoir* rimReservoir = dynamic_cast<RimResultReservoir*>(caseCollection()->reservoirs()[i]);
CVF_ASSERT(rimReservoir);
RimResultReservoir* rimReservoir = dynamic_cast<RimResultReservoir*>(caseCollection()->reservoirs[i]);
if(!rimReservoir) continue; // Input reservoir
if (!rimReservoir->openAndReadActiveCellData(mainEclipseCase))
{
CVF_ASSERT(false);
}
info.setProgress(i);
info.incrementProgress();
}
m_mainGrid = mainEclipseCase->mainGrid();
// Check if we need to calculate the union of the active cells
bool foundResultsInCache = false;
for (size_t i = 0; i < statisticalReservoirCollection()->reservoirs().size(); i++)
for (size_t i = 0; i < statisticalReservoirCollection()->reservoirs.size(); i++)
{
RimStatisticalCalculation* rimReservoir = statisticalReservoirCollection()->reservoirs()[i];
RimStatisticalCalculation* rimReservoir = statisticalReservoirCollection()->reservoirs[i];
// Check if any results are stored in cache
if (rimReservoir->results(RifReaderInterface::MATRIX_RESULTS)->m_resultCacheMetaData.size() > 0 ||
rimReservoir->results(RifReaderInterface::FRACTURE_RESULTS)->m_resultCacheMetaData.size() > 0)
if (rimReservoir->results(RifReaderInterface::MATRIX_RESULTS)->storedResultsCount() > 0 ||
rimReservoir->results(RifReaderInterface::FRACTURE_RESULTS)->storedResultsCount() > 0)
{
foundResultsInCache = true;
break;
@@ -192,11 +192,22 @@ void RimIdenticalGridCaseGroup::initAfterRead()
computeUnionOfActiveCells();
}
m_mainGrid = mainEclipseCase->mainGrid();
// "Load" the statistical cases
updateMainGridAndActiveCellsForStatisticsCases();
for (size_t i = 0; i < statisticalReservoirCollection()->reservoirs.size(); i++)
{
RimStatisticalCalculation* rimReservoir = statisticalReservoirCollection()->reservoirs[i];
rimReservoir->openEclipseGridFile();
if (i == 0)
{
rimReservoir->reservoirData()->computeActiveCellBoundingBoxes();
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -209,13 +220,11 @@ void RimIdenticalGridCaseGroup::computeUnionOfActiveCells()
if (caseCollection->reservoirs.size() == 0 || !m_mainGrid)
{
m_unionOfMatrixActiveCells = new RigActiveCellInfo;
m_unionOfFractureActiveCells = new RigActiveCellInfo;
this->clearActiveCellUnions();
return;
}
m_unionOfMatrixActiveCells->setGlobalCellCount(m_mainGrid->cells().size());
m_unionOfFractureActiveCells->setGlobalCellCount(m_mainGrid->cells().size());
m_unionOfMatrixActiveCells->setGridCount(m_mainGrid->gridCount());
@@ -291,12 +300,10 @@ RimStatisticalCalculation* RimIdenticalGridCaseGroup::createAndAppendStatistical
RimStatisticalCalculation* newObject = new RimStatisticalCalculation;
newObject->caseName = QString("Statistics ") + QString::number(statisticalReservoirCollection()->reservoirs.size()+1);
newObject->setMainGrid(this->mainGrid());
newObject->reservoirData()->setActiveCellInfo(RifReaderInterface::MATRIX_RESULTS, m_unionOfMatrixActiveCells.p());
newObject->reservoirData()->setActiveCellInfo(RifReaderInterface::FRACTURE_RESULTS, m_unionOfFractureActiveCells.p());
statisticalReservoirCollection()->reservoirs.push_back(newObject);
newObject->openEclipseGridFile();
return newObject;
}
@@ -309,13 +316,11 @@ void RimIdenticalGridCaseGroup::updateMainGridAndActiveCellsForStatisticsCases()
{
RimStatisticalCalculation* rimStaticsCase = statisticalReservoirCollection->reservoirs[i];
rimStaticsCase->setMainGrid(this->mainGrid());
rimStaticsCase->reservoirData()->setActiveCellInfo(RifReaderInterface::MATRIX_RESULTS, m_unionOfMatrixActiveCells.p());
rimStaticsCase->reservoirData()->setActiveCellInfo(RifReaderInterface::FRACTURE_RESULTS, m_unionOfFractureActiveCells.p());
rimStaticsCase->reservoirData()->setMainGrid(this->mainGrid());
if (i == 0)
{
rimStaticsCase->reservoirData()->computeCachedData();
rimStaticsCase->reservoirData()->computeActiveCellBoundingBoxes();
}
}
}
@@ -338,8 +343,8 @@ void RimIdenticalGridCaseGroup::clearStatisticsResults()
//--------------------------------------------------------------------------------------------------
void RimIdenticalGridCaseGroup::clearActiveCellUnions()
{
m_unionOfMatrixActiveCells = new RigActiveCellInfo;
m_unionOfFractureActiveCells = new RigActiveCellInfo;
m_unionOfMatrixActiveCells->clear();
m_unionOfFractureActiveCells->clear();
}
//--------------------------------------------------------------------------------------------------
@@ -361,3 +366,14 @@ bool RimIdenticalGridCaseGroup::contains(RimReservoir* reservoir) const
return false;
}
RigActiveCellInfo* RimIdenticalGridCaseGroup::unionOfActiveCells(RifReaderInterface::PorosityModelResultType porosityType)
{
if (porosityType == RifReaderInterface::MATRIX_RESULTS)
{
return m_unionOfMatrixActiveCells.p();
}
else
{
return m_unionOfFractureActiveCells.p();
}
}
@@ -54,21 +54,21 @@ public:
caf::PdmField<RimCaseCollection*> caseCollection;
caf::PdmField<RimStatisticalCollection*> statisticalReservoirCollection;
void loadMainCaseAndActiveCellInfo();
RigMainGrid* mainGrid();
RigActiveCellInfo* unionOfActiveCells(RifReaderInterface::PorosityModelResultType porosityType);
void computeUnionOfActiveCells();
protected:
virtual caf::PdmFieldHandle* userDescriptionField();
virtual void initAfterRead();
private:
void updateMainGridAndActiveCellsForStatisticsCases();
void clearStatisticsResults();
void clearActiveCellUnions();
private:
RigMainGrid* m_mainGrid;
@@ -261,7 +261,7 @@ void RimReservoir::computeCachedData()
RigEclipseCase* rigEclipseCase = reservoirData();
if (rigEclipseCase)
{
rigEclipseCase->computeCachedData();
rigEclipseCase->computeActiveCellBoundingBoxes();
rigEclipseCase->mainGrid()->computeCachedData();
@@ -22,6 +22,7 @@
#include "RIApplication.h"
#include "RigMainGrid.h"
#include "RigCell.h"
#include "cafProgressInfo.h"
CAF_PDM_SOURCE_INIT(RimReservoirCellResultsStorage, "ReservoirCellResultStorage");
@@ -58,16 +59,36 @@ RimReservoirCellResultsStorage::~RimReservoirCellResultsStorage()
//--------------------------------------------------------------------------------------------------
void RimReservoirCellResultsStorage::setupBeforeSave()
{
m_resultCacheMetaData.deleteAllChildObjects();
QString newValidCacheFileName = getValidCacheFileName();
// Delete the storage file
QFileInfo storageFileInfo(newValidCacheFileName);
if (storageFileInfo.exists())
{
QDir storageDir = storageFileInfo.dir();
storageDir.remove(storageFileInfo.fileName());
}
if (!m_cellResults) return;
const std::vector<RigReservoirCellResults::ResultInfo>& resInfo = m_cellResults->infoForEachResultIndex();
m_resultCacheMetaData.deleteAllChildObjects();
if(resInfo.size())
bool hasResultsToStore = false;
for (size_t rIdx = 0; rIdx < resInfo.size(); ++rIdx)
{
if (resInfo[rIdx].m_needsToBeStored)
{
hasResultsToStore = true;
break;
}
}
if(resInfo.size() && hasResultsToStore)
{
QDir::root().mkpath(getCacheDirectoryPath());
QString newValidCacheFileName = getValidCacheFileName();
QFile cacheFile(newValidCacheFileName);
if (!cacheFile.open(QIODevice::WriteOnly))
@@ -79,16 +100,22 @@ void RimReservoirCellResultsStorage::setupBeforeSave()
m_resultCacheFileName = newValidCacheFileName;
QDataStream stream(&cacheFile);
stream.setVersion(QDataStream::Qt_4_0);
stream.setVersion(QDataStream::Qt_4_6);
stream << (quint32)0xCEECAC4E; // magic number
stream << (quint32)1; // Version number. Increment if needing to extend the format in ways that can not be handled generically by the reader
caf::ProgressInfo progInfo(resInfo.size(), "Saving generated and imported properties");
for (size_t rIdx = 0; rIdx < resInfo.size(); ++rIdx)
{
// If there is no data, we do not store anything for the current result variable
// (Even not the metadata, of cause)
size_t timestepCount = m_cellResults->cellScalarResults(resInfo[rIdx].m_gridScalarResultIndex).size();
if (timestepCount)
if (timestepCount && resInfo[rIdx].m_needsToBeStored)
{
progInfo.setProgressDescription(resInfo[rIdx].m_resultName);
// Create and setup the cache information for this result
RimReservoirCellResultsStorageEntryInfo* cacheEntry = new RimReservoirCellResultsStorageEntryInfo;
m_resultCacheMetaData.push_back(cacheEntry);
@@ -125,10 +152,13 @@ void RimReservoirCellResultsStorage::setupBeforeSave()
}
}
}
progInfo.incrementProgress();
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -256,7 +286,15 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResult(RimDefines::Result
if (resultGridIndex == cvf::UNDEFINED_SIZE_T) return cvf::UNDEFINED_SIZE_T;
if (m_cellResults->cellScalarResults(resultGridIndex).size()) return resultGridIndex;
// If we have any results on any timestep, assume we have loaded results already
for (size_t tsIdx = 0; tsIdx < m_cellResults->timeStepCount(resultGridIndex); ++tsIdx)
{
if (m_cellResults->cellScalarResults(resultGridIndex, tsIdx).size())
{
return resultGridIndex;
}
}
if (type == RimDefines::GENERATED)
{
@@ -369,7 +407,7 @@ void RimReservoirCellResultsStorage::loadOrComputeSOILForTimeStep(size_t timeSte
size_t soilResultGridIndex = findOrLoadScalarResult(RimDefines::DYNAMIC_NATIVE, "SOIL");
if (soilResultGridIndex == cvf::UNDEFINED_SIZE_T)
{
soilResultGridIndex = m_cellResults->addEmptyScalarResult(RimDefines::DYNAMIC_NATIVE, "SOIL");
soilResultGridIndex = m_cellResults->addEmptyScalarResult(RimDefines::DYNAMIC_NATIVE, "SOIL", false);
CVF_ASSERT(soilResultGridIndex != cvf::UNDEFINED_SIZE_T);
m_cellResults->cellScalarResults(soilResultGridIndex).resize(soilTimeStepCount);
@@ -424,37 +462,37 @@ void RimReservoirCellResultsStorage::computeDepthRelatedResults()
if (depthResultGridIndex == cvf::UNDEFINED_SIZE_T)
{
depthResultGridIndex = m_cellResults->addStaticScalarResult(RimDefines::STATIC_NATIVE, "DEPTH", resultValueCount);
depthResultGridIndex = m_cellResults->addStaticScalarResult(RimDefines::STATIC_NATIVE, "DEPTH", false, resultValueCount);
computeDepth = true;
}
if (dxResultGridIndex == cvf::UNDEFINED_SIZE_T)
{
dxResultGridIndex = m_cellResults->addStaticScalarResult(RimDefines::STATIC_NATIVE, "DX", resultValueCount);
dxResultGridIndex = m_cellResults->addStaticScalarResult(RimDefines::STATIC_NATIVE, "DX", false, resultValueCount);
computeDx = true;
}
if (dyResultGridIndex == cvf::UNDEFINED_SIZE_T)
{
dyResultGridIndex = m_cellResults->addStaticScalarResult(RimDefines::STATIC_NATIVE, "DY", resultValueCount);
dyResultGridIndex = m_cellResults->addStaticScalarResult(RimDefines::STATIC_NATIVE, "DY", false, resultValueCount);
computeDy = true;
}
if (dzResultGridIndex == cvf::UNDEFINED_SIZE_T)
{
dzResultGridIndex = m_cellResults->addStaticScalarResult(RimDefines::STATIC_NATIVE, "DZ", resultValueCount);
dzResultGridIndex = m_cellResults->addStaticScalarResult(RimDefines::STATIC_NATIVE, "DZ", false, resultValueCount);
computeDz = true;
}
if (topsResultGridIndex == cvf::UNDEFINED_SIZE_T)
{
topsResultGridIndex = m_cellResults->addStaticScalarResult(RimDefines::STATIC_NATIVE, "TOPS", resultValueCount);
topsResultGridIndex = m_cellResults->addStaticScalarResult(RimDefines::STATIC_NATIVE, "TOPS", false, resultValueCount);
computeTops = true;
}
if (bottomResultGridIndex == cvf::UNDEFINED_SIZE_T)
{
bottomResultGridIndex = m_cellResults->addStaticScalarResult(RimDefines::STATIC_NATIVE, "BOTTOM", resultValueCount);
bottomResultGridIndex = m_cellResults->addStaticScalarResult(RimDefines::STATIC_NATIVE, "BOTTOM", false, resultValueCount);
computeBottom = true;
}
@@ -539,6 +577,84 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResult(const QString& res
void RimReservoirCellResultsStorage::setCellResults(RigReservoirCellResults* cellResults)
{
m_cellResults = cellResults;
if (m_cellResults == NULL)
return;
// Now that we have got the results container, we can finally
// Read data from the internal storage and populate it
if (m_resultCacheFileName().isEmpty())
return;
// Get the name of the cache name relative to the current project file position
QString newValidCacheFileName = getValidCacheFileName();
QFile storageFile(newValidCacheFileName);
// Warn if we thought we were to find some data on the storage file
if (!storageFile.exists() && m_resultCacheMetaData.size())
{
qWarning() << "Reading stored results: Missing the storage file : " + newValidCacheFileName;
return;
}
if (!storageFile.open(QIODevice::ReadOnly))
{
qWarning() << "Reading stored results: Can't open the file : " + newValidCacheFileName;
return;
}
QDataStream stream(&storageFile);
stream.setVersion(QDataStream::Qt_4_6);
quint32 magicNumber = 0;
quint32 versionNumber = 0;
stream >> magicNumber;
if (magicNumber != 0xCEECAC4E)
{
qWarning() << "Reading stored results: The storage file has wrong type ";
return;
}
stream >> versionNumber;
if (versionNumber > 1 )
{
qWarning() << "Reading stored results: The storage file has been written by a newer version of ResInsight";
return;
}
caf::ProgressInfo progress(m_resultCacheMetaData.size(), "Reading internally stored results");
// Fill the object with data from the storage
for (size_t rIdx = 0; rIdx < m_resultCacheMetaData.size(); ++rIdx)
{
RimReservoirCellResultsStorageEntryInfo* resInfo = m_resultCacheMetaData[rIdx];
size_t resultIndex = m_cellResults->addEmptyScalarResult(resInfo->m_resultType(), resInfo->m_resultName(), true);
m_cellResults->setTimeStepDates(resultIndex, resInfo->m_timeStepDates());
progress.setProgressDescription(resInfo->m_resultName);
for (size_t tsIdx = 0; tsIdx < resInfo->m_timeStepDates().size(); ++tsIdx)
{
std::vector<double>* data = NULL;
data = &(m_cellResults->cellScalarResults(rIdx, tsIdx));
quint64 cellCount = 0;
stream >> cellCount;
data->resize(cellCount, HUGE_VAL);
for (size_t cIdx = 0; cIdx < cellCount; ++cIdx)
{
stream >> (*data)[cIdx];
}
}
progress.incrementProgress();
}
}
//--------------------------------------------------------------------------------------------------
@@ -549,6 +665,14 @@ void RimReservoirCellResultsStorage::setMainGrid(RigMainGrid* mainGrid)
m_ownerMainGrid = mainGrid;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RimReservoirCellResultsStorage::storedResultsCount()
{
return m_resultCacheMetaData.size();
}
CAF_PDM_SOURCE_INIT(RimReservoirCellResultsStorageEntryInfo, "ResultStorageEntryInfo");
@@ -36,35 +36,39 @@ public:
RimReservoirCellResultsStorage();
virtual ~RimReservoirCellResultsStorage();
// Fields
caf::PdmField<QString> m_resultCacheFileName;
caf::PdmPointersField<RimReservoirCellResultsStorageEntryInfo*>
m_resultCacheMetaData;
void setCellResults(RigReservoirCellResults* cellResults);
RigReservoirCellResults* cellResults() { return m_cellResults; }
const RigReservoirCellResults* cellResults() const { return m_cellResults; }
void setCellResults(RigReservoirCellResults* cellResults);
size_t storedResultsCount();
void setMainGrid(RigMainGrid* mainGrid);
void setReaderInterface(RifReaderInterface* readerInterface);
RifReaderInterface* readerInterface();
void loadOrComputeSOIL();
void loadOrComputeSOILForTimeStep(size_t timeStepIndex);
void computeDepthRelatedResults();
size_t findOrLoadScalarResultForTimeStep(RimDefines::ResultCatType type, const QString& resultName, size_t timeStepIndex);
size_t findOrLoadScalarResult(RimDefines::ResultCatType type, const QString& resultName);
size_t findOrLoadScalarResult(const QString& resultName); ///< Simplified search. Assumes unique names across types.
protected:
// Overridden methods from PdmObject
virtual void setupBeforeSave();
private:
void loadOrComputeSOILForTimeStep(size_t timeStepIndex);
QString getValidCacheFileName();
QString getCacheDirectoryPath();
// Fields
caf::PdmField<QString> m_resultCacheFileName;
caf::PdmPointersField<RimReservoirCellResultsStorageEntryInfo*>
m_resultCacheMetaData;
cvf::ref<RifReaderInterface> m_readerInterface;
RigReservoirCellResults* m_cellResults;
RigMainGrid* m_ownerMainGrid;
@@ -145,7 +145,7 @@ bool RimResultReservoir::openAndReadActiveCellData(RigEclipseCase* mainEclipseCa
CVF_ASSERT(this->reservoirData());
CVF_ASSERT(readerInterface.notNull());
reservoirData()->computeCachedData();
reservoirData()->computeActiveCellBoundingBoxes();
return true;
}
@@ -40,9 +40,6 @@ RimStatisticalCalculation::RimStatisticalCalculation()
CAF_PDM_InitObject("Case Group Statistics", ":/Histogram16x16.png", "", "");
CAF_PDM_InitField(&m_resultName, "ResultName", QString("PRESSURE"), "ResultName", "", "", "");
m_readerInterface = new RifReaderStatisticalCalculation;
openEclipseGridFile();
}
//--------------------------------------------------------------------------------------------------
@@ -74,16 +71,20 @@ bool RimStatisticalCalculation::openEclipseGridFile()
cvf::ref<RigEclipseCase> eclipseCase = new RigEclipseCase;
if (!m_readerInterface->open("dummy", eclipseCase.p()))
{
return false;
}
CVF_ASSERT(parentStatisticalCollection());
RimIdenticalGridCaseGroup* gridCaseGroup = parentStatisticalCollection()->parentCaseGroup();
CVF_ASSERT(gridCaseGroup);
RigMainGrid* mainGrid = gridCaseGroup->mainGrid();
eclipseCase->setMainGrid(mainGrid);
eclipseCase->setActiveCellInfo(RifReaderInterface::MATRIX_RESULTS, gridCaseGroup->unionOfActiveCells(RifReaderInterface::MATRIX_RESULTS));
eclipseCase->setActiveCellInfo(RifReaderInterface::FRACTURE_RESULTS, gridCaseGroup->unionOfActiveCells(RifReaderInterface::FRACTURE_RESULTS));
this->setReservoirData( eclipseCase.p() );
results(RifReaderInterface::MATRIX_RESULTS)->setReaderInterface(m_readerInterface.p());
results(RifReaderInterface::FRACTURE_RESULTS)->setReaderInterface(m_readerInterface.p());
return true;
}
@@ -150,11 +151,11 @@ void RimStatisticalCalculation::computeStatistics()
QList<QPair<RimDefines::ResultCatType, QString> > resultSpecification;
resultSpecification.append(qMakePair(RimDefines::DYNAMIC_NATIVE, QString("PRESSURE")));
//resultSpecification.append(qMakePair(RimDefines::DYNAMIC_NATIVE, QString("PRESSURE")));
/*
{
QStringList resultNames = sourceCases.at(0)->results(RifReaderInterface::MATRIX_RESULTS)->resultNames(RimDefines::DYNAMIC_NATIVE);
QStringList resultNames = sourceCases.at(0)->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->resultNames(RimDefines::DYNAMIC_NATIVE);
foreach(QString resultName, resultNames)
{
resultSpecification.append(qMakePair(RimDefines::DYNAMIC_NATIVE, resultName));
@@ -162,13 +163,13 @@ void RimStatisticalCalculation::computeStatistics()
}
{
QStringList resultNames = sourceCases.at(0)->results(RifReaderInterface::MATRIX_RESULTS)->resultNames(RimDefines::STATIC_NATIVE);
QStringList resultNames = sourceCases.at(0)->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->resultNames(RimDefines::STATIC_NATIVE);
foreach(QString resultName, resultNames)
{
resultSpecification.append(qMakePair(RimDefines::STATIC_NATIVE, resultName));
}
}
*/
RigStatistics stat(sourceCases, timeStepIndices, statisticsConfig, resultCase);
stat.evaluateStatistics(resultSpecification);