From 31261a800f5b16355b7fda1a354839472abd5789 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 27 Oct 2014 07:19:04 +0100 Subject: [PATCH] Removed obsolete code and added comments --- .../RimIdenticalGridCaseGroup.cpp | 9 +++- .../RimStatisticsCaseEvaluator.cpp | 49 ++----------------- 2 files changed, 10 insertions(+), 48 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp index a79c07b647..32b4f4c81e 100644 --- a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp +++ b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp @@ -164,7 +164,9 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() return; } - // Read active cell info from all source cases + // Action A : Read active cell info + // Read active cell info from all source cases. The file access is optimized for this purpose, and result meta data + // is copied from main case to all other cases (see "Action B") caf::ProgressInfo info(caseCollection()->reservoirs.size(), "Case group - Reading Active Cell data"); for (size_t i = 1; i < caseCollection()->reservoirs.size(); i++) @@ -204,7 +206,10 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() computeUnionOfActiveCells(); } - // Propagate result meta data to all cases + // Action B : Copy result meta data from main case to all other cases in grid case group + + // This code was originally part of RimStatisticsCaseEvaluator, but moved here to be a general solution + // for all cases { RifReaderInterface::PorosityModelResultType poroModel = RifReaderInterface::MATRIX_RESULTS; diff --git a/ApplicationCode/ProjectDataModel/RimStatisticsCaseEvaluator.cpp b/ApplicationCode/ProjectDataModel/RimStatisticsCaseEvaluator.cpp index b38eb8763a..70524a840b 100644 --- a/ApplicationCode/ProjectDataModel/RimStatisticsCaseEvaluator.cpp +++ b/ApplicationCode/ProjectDataModel/RimStatisticsCaseEvaluator.cpp @@ -67,30 +67,6 @@ QString createResultNameRange(const QString& resultName) { return resultName + QString createResultNamePVal(const QString& resultName, double pValPos) { return resultName + "_P_" + QString::number(pValPos); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimStatisticsCaseEvaluator::buildSourceMetaData(RifReaderInterface::PorosityModelResultType poroModel, RimDefines::ResultCatType resultType, const QString& resultName) -{ - if (m_sourceCases.size() == 0) return; - - std::vector timeStepDates = m_sourceCases[0]->results(poroModel)->cellResults()->timeStepDates(0); - - for (size_t caseIdx = 1; caseIdx < m_sourceCases.size(); caseIdx++) - { - RimReservoirCellResultsStorage* cellResultsStorage = m_sourceCases[caseIdx]->results(poroModel); - size_t scalarResultIndex = cellResultsStorage->cellResults()->findScalarResultIndex(resultType, resultName); - if (scalarResultIndex == cvf::UNDEFINED_SIZE_T) - { - size_t scalarResultIndex = cellResultsStorage->cellResults()->addEmptyScalarResult(resultType, resultName, false); - cellResultsStorage->cellResults()->setTimeStepDates(scalarResultIndex, timeStepDates); - - std::vector< std::vector >& dataValues = cellResultsStorage->cellResults()->cellScalarResults(scalarResultIndex); - dataValues.resize(timeStepDates.size()); - } - } -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -109,28 +85,9 @@ void RimStatisticsCaseEvaluator::evaluateForResults(const QList& result size_t activeCellCount = m_destinationCase->activeCellInfo(poroModel)->reservoirActiveCellCount(); RigCaseCellResultsData* destCellResultsData = m_destinationCase->results(poroModel); -// // Special handling if SOIL is asked for -// // Build SGAS/SWAT meta data, SOIL is automatically generated as part of RigCaseCellResultsData::findOrLoadScalarResultForTimeStep -// if (resultName.toUpper() == "SOIL") -// { -// size_t swatIndex = m_sourceCases.at(0)->results(poroModel)->cellResults()->findScalarResultIndex(resultType, "SWAT"); -// if (swatIndex != cvf::UNDEFINED_SIZE_T) -// { -// buildSourceMetaData(poroModel, resultType, "SWAT"); -// } -// -// size_t sgasIndex = m_sourceCases.at(0)->results(poroModel)->cellResults()->findScalarResultIndex(resultType, "SGAS"); -// if (sgasIndex != cvf::UNDEFINED_SIZE_T) -// { -// buildSourceMetaData(poroModel, resultType, "SGAS"); -// } -// } -// else -// { -// // Meta info is loaded from disk for first case only -// // Build metadata for all other source cases -// buildSourceMetaData(poroModel, resultType, resultName); -// } + // Placeholder data used to be created here, + // this is now moved to RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() + // Create new result data structures to contain the statistical values std::vector statisticalResultNames;