#3531 Temporary LGR : Move function and whitespace changes

This commit is contained in:
Magne Sjaastad committed 2018-10-23 21:36:20 +02:00
1 parent 577a706b57
commit 08776a09b3
2 files changed
+135 -84

No files matched your search

@@ -25,8 +25,8 @@
#include "RigEclipseCaseData.h"
#include "RigEclipseMultiPropertyStatCalc.h"
#include "RigEclipseNativeStatCalc.h"
#include "RigMainGrid.h"
#include "RigEclipseResultInfo.h"
#include "RigMainGrid.h"
#include "RigStatisticsDataCache.h"
#include "RigStatisticsMath.h"
@@ -46,7 +46,8 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigCaseCellResultsData::RigCaseCellResultsData(RigEclipseCaseData* ownerCaseData) : m_activeCellInfo(nullptr)
RigCaseCellResultsData::RigCaseCellResultsData(RigEclipseCaseData* ownerCaseData)
: m_activeCellInfo(nullptr)
{
CVF_ASSERT(ownerCaseData != nullptr);
CVF_ASSERT(ownerCaseData->mainGrid() != nullptr);
@@ -63,6 +64,14 @@ void RigCaseCellResultsData::setMainGrid(RigMainGrid* ownerGrid)
m_ownerMainGrid = ownerGrid;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigCaseCellResultsData::setActiveCellInfo(RigActiveCellInfo* activeCellInfo)
{
m_activeCellInfo = activeCellInfo;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -288,7 +297,9 @@ size_t RigCaseCellResultsData::findScalarResultIndex(const QString& resultName)
/// Adds an empty scalar set, and returns the scalarResultIndex to it.
/// if resultName already exists, it just returns the scalarResultIndex to the existing result.
//--------------------------------------------------------------------------------------------------
size_t RigCaseCellResultsData::findOrCreateScalarResultIndex(RiaDefines::ResultCatType type, const QString& resultName, bool needsToBeStored)
size_t RigCaseCellResultsData::findOrCreateScalarResultIndex(RiaDefines::ResultCatType type,
const QString& resultName,
bool needsToBeStored)
{
size_t scalarResultIndex = this->findScalarResultIndex(type, resultName);
@@ -337,25 +348,34 @@ size_t RigCaseCellResultsData::findOrCreateScalarResultIndex(RiaDefines::ResultC
else if (resultName == RiaDefines::combinedRiTranResultName())
{
cvf::ref<RigEclipseMultiPropertyStatCalc> calc = new RigEclipseMultiPropertyStatCalc();
calc->addNativeStatisticsCalculator(this, findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riTranXResultName()));
calc->addNativeStatisticsCalculator(this, findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riTranYResultName()));
calc->addNativeStatisticsCalculator(this, findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riTranZResultName()));
calc->addNativeStatisticsCalculator(this,
findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riTranXResultName()));
calc->addNativeStatisticsCalculator(this,
findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riTranYResultName()));
calc->addNativeStatisticsCalculator(this,
findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riTranZResultName()));
statisticsCalculator = calc;
}
else if (resultName == RiaDefines::combinedRiMultResultName())
{
cvf::ref<RigEclipseMultiPropertyStatCalc> calc = new RigEclipseMultiPropertyStatCalc();
calc->addNativeStatisticsCalculator(this, findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riMultXResultName()));
calc->addNativeStatisticsCalculator(this, findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riMultYResultName()));
calc->addNativeStatisticsCalculator(this, findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riMultZResultName()));
calc->addNativeStatisticsCalculator(this,
findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riMultXResultName()));
calc->addNativeStatisticsCalculator(this,
findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riMultYResultName()));
calc->addNativeStatisticsCalculator(this,
findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riMultZResultName()));
statisticsCalculator = calc;
}
else if (resultName == RiaDefines::combinedRiAreaNormTranResultName())
{
cvf::ref<RigEclipseMultiPropertyStatCalc> calc = new RigEclipseMultiPropertyStatCalc();
calc->addNativeStatisticsCalculator(this, findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riAreaNormTranXResultName()));
calc->addNativeStatisticsCalculator(this, findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riAreaNormTranYResultName()));
calc->addNativeStatisticsCalculator(this, findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riAreaNormTranZResultName()));
calc->addNativeStatisticsCalculator(
this, findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riAreaNormTranXResultName()));
calc->addNativeStatisticsCalculator(
this, findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riAreaNormTranYResultName()));
calc->addNativeStatisticsCalculator(
this, findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riAreaNormTranZResultName()));
statisticsCalculator = calc;
}
else if (resultName == RiaDefines::combinedWaterFluxResultName())
@@ -419,6 +439,22 @@ QStringList RigCaseCellResultsData::resultNames(RiaDefines::ResultCatType resTyp
return varList;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigActiveCellInfo* RigCaseCellResultsData::activeCellInfo()
{
return m_activeCellInfo;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const RigActiveCellInfo* RigCaseCellResultsData::activeCellInfo() const
{
return m_activeCellInfo;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -674,7 +710,10 @@ bool RigCaseCellResultsData::isResultLoaded(const RigEclipseResultInfo& resultIn
/// Make sure we have a result with given type and name, and make sure one "timestep" result vector
// for the static result values are allocated
//--------------------------------------------------------------------------------------------------
size_t RigCaseCellResultsData::addStaticScalarResult(RiaDefines::ResultCatType type, const QString& resultName, bool needsToBeStored, size_t resultValueCount)
size_t RigCaseCellResultsData::addStaticScalarResult(RiaDefines::ResultCatType type,
const QString& resultName,
bool needsToBeStored,
size_t resultValueCount)
{
size_t resultIdx = findOrCreateScalarResultIndex(type, resultName, needsToBeStored);
@@ -706,7 +745,11 @@ bool RigCaseCellResultsData::updateResultName(RiaDefines::ResultCatType resultTy
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const std::vector<double>* RigCaseCellResultsData::getResultIndexableStaticResult(RigActiveCellInfo* actCellInfo, RigCaseCellResultsData* gridCellResults, QString porvResultName, std::vector<double> &activeCellsResultsTempContainer)
const std::vector<double>*
RigCaseCellResultsData::getResultIndexableStaticResult(RigActiveCellInfo* actCellInfo,
RigCaseCellResultsData* gridCellResults,
QString porvResultName,
std::vector<double>& activeCellsResultsTempContainer)
{
size_t resultCellCount = actCellInfo->reservoirCellResultCount();
size_t reservoirCellCount = actCellInfo->reservoirCellCount();
@@ -739,6 +782,14 @@ const std::vector<double>* RigCaseCellResultsData::getResultIndexableStaticResul
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const std::vector<RigEclipseResultInfo>& RigCaseCellResultsData::infoForEachResultIndex()
{
return m_resultInfos;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -859,9 +910,9 @@ void RigCaseCellResultsData::createPlaceholderResultEntries()
// riTRANSXYZ and X,Y,Z
{
if ( findScalarResultIndex(RiaDefines::STATIC_NATIVE, "PERMX") != cvf::UNDEFINED_SIZE_T
&& findScalarResultIndex(RiaDefines::STATIC_NATIVE, "PERMY") != cvf::UNDEFINED_SIZE_T
&& findScalarResultIndex(RiaDefines::STATIC_NATIVE, "PERMZ") != cvf::UNDEFINED_SIZE_T)
if (findScalarResultIndex(RiaDefines::STATIC_NATIVE, "PERMX") != cvf::UNDEFINED_SIZE_T &&
findScalarResultIndex(RiaDefines::STATIC_NATIVE, "PERMY") != cvf::UNDEFINED_SIZE_T &&
findScalarResultIndex(RiaDefines::STATIC_NATIVE, "PERMZ") != cvf::UNDEFINED_SIZE_T)
{
addStaticScalarResult(RiaDefines::STATIC_NATIVE, RiaDefines::riTranXResultName(), false, 0);
addStaticScalarResult(RiaDefines::STATIC_NATIVE, RiaDefines::riTranYResultName(), false, 0);
@@ -873,10 +924,10 @@ void RigCaseCellResultsData::createPlaceholderResultEntries()
// riMULTXYZ and X, Y, Z
{
size_t tranX, tranY, tranZ;
if (findTransmissibilityResults(tranX, tranY, tranZ)
&& findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riTranXResultName()) != cvf::UNDEFINED_SIZE_T
&& findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riTranYResultName()) != cvf::UNDEFINED_SIZE_T
&& findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riTranZResultName()) != cvf::UNDEFINED_SIZE_T)
if (findTransmissibilityResults(tranX, tranY, tranZ) &&
findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riTranXResultName()) != cvf::UNDEFINED_SIZE_T &&
findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riTranYResultName()) != cvf::UNDEFINED_SIZE_T &&
findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::riTranZResultName()) != cvf::UNDEFINED_SIZE_T)
{
addStaticScalarResult(RiaDefines::STATIC_NATIVE, RiaDefines::riMultXResultName(), false, 0);
addStaticScalarResult(RiaDefines::STATIC_NATIVE, RiaDefines::riMultYResultName(), false, 0);
@@ -927,9 +978,7 @@ bool RigCaseCellResultsData::findTransmissibilityResults(size_t& tranX, size_t&
tranY = findScalarResultIndex(RiaDefines::STATIC_NATIVE, "TRANY");
tranZ = findScalarResultIndex(RiaDefines::STATIC_NATIVE, "TRANZ");
if (tranX == cvf::UNDEFINED_SIZE_T ||
tranY == cvf::UNDEFINED_SIZE_T ||
tranZ == cvf::UNDEFINED_SIZE_T)
if (tranX == cvf::UNDEFINED_SIZE_T || tranY == cvf::UNDEFINED_SIZE_T || tranZ == cvf::UNDEFINED_SIZE_T)
{
return false;
}
@@ -937,7 +986,6 @@ bool RigCaseCellResultsData::findTransmissibilityResults(size_t& tranX, size_t&
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -1002,9 +1050,8 @@ size_t RigCaseCellResultsData::findOrLoadScalarResult(RiaDefines::ResultCatType
computeRiTransComponent(RiaDefines::riTranZResultName());
computeNncCombRiTrans();
}
else if (resultName == RiaDefines::riTranXResultName()
|| resultName == RiaDefines::riTranYResultName()
|| resultName == RiaDefines::riTranZResultName())
else if (resultName == RiaDefines::riTranXResultName() || resultName == RiaDefines::riTranYResultName() ||
resultName == RiaDefines::riTranZResultName())
{
computeRiTransComponent(resultName);
}
@@ -1016,9 +1063,8 @@ size_t RigCaseCellResultsData::findOrLoadScalarResult(RiaDefines::ResultCatType
computeNncCombRiTrans();
computeNncCombRiMULT();
}
else if (resultName == RiaDefines::riMultXResultName()
|| resultName == RiaDefines::riMultYResultName()
|| resultName == RiaDefines::riMultZResultName())
else if (resultName == RiaDefines::riMultXResultName() || resultName == RiaDefines::riMultYResultName() ||
resultName == RiaDefines::riMultZResultName())
{
computeRiMULTComponent(resultName);
}
@@ -1029,9 +1075,8 @@ size_t RigCaseCellResultsData::findOrLoadScalarResult(RiaDefines::ResultCatType
computeRiTRANSbyAreaComponent(RiaDefines::riAreaNormTranZResultName());
computeNncCombRiTRANSbyArea();
}
else if (resultName == RiaDefines::riAreaNormTranXResultName()
|| resultName == RiaDefines::riAreaNormTranYResultName()
|| resultName == RiaDefines::riAreaNormTranZResultName())
else if (resultName == RiaDefines::riAreaNormTranXResultName() || resultName == RiaDefines::riAreaNormTranYResultName() ||
resultName == RiaDefines::riAreaNormTranZResultName())
{
computeRiTRANSbyAreaComponent(resultName);
}
@@ -1183,7 +1228,9 @@ size_t RigCaseCellResultsData::findOrLoadScalarResult(RiaDefines::ResultCatType
/// This method is intended to be used for multicase cross statistical calculations, when
/// we need process one timestep at a time, freeing memory as we go.
//--------------------------------------------------------------------------------------------------
size_t RigCaseCellResultsData::findOrLoadScalarResultForTimeStep(RiaDefines::ResultCatType type, const QString& resultName, size_t timeStepIndex)
size_t RigCaseCellResultsData::findOrLoadScalarResultForTimeStep(RiaDefines::ResultCatType type,
const QString& resultName,
size_t timeStepIndex)
{
// Special handling for SOIL
if (type == RiaDefines::DYNAMIC_NATIVE && resultName.toUpper() == "SOIL")
@@ -1276,10 +1323,8 @@ size_t RigCaseCellResultsData::findOrLoadScalarResultForTimeStep(RiaDefines::Res
}
return scalarResultIndex;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -1392,7 +1437,6 @@ void RigCaseCellResultsData::computeSOILForTimeStep(size_t timeStepIndex)
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -1542,19 +1586,22 @@ void RigCaseCellResultsData::computeDepthRelatedResults()
if (computeDx)
{
cvf::Vec3d cellWidth = cell.faceCenter(cvf::StructGridInterface::NEG_I) - cell.faceCenter(cvf::StructGridInterface::POS_I);
cvf::Vec3d cellWidth =
cell.faceCenter(cvf::StructGridInterface::NEG_I) - cell.faceCenter(cvf::StructGridInterface::POS_I);
dx[0][cellIdx] = cellWidth.length();
}
if (computeDy)
{
cvf::Vec3d cellWidth = cell.faceCenter(cvf::StructGridInterface::NEG_J) - cell.faceCenter(cvf::StructGridInterface::POS_J);
cvf::Vec3d cellWidth =
cell.faceCenter(cvf::StructGridInterface::NEG_J) - cell.faceCenter(cvf::StructGridInterface::POS_J);
dy[0][cellIdx] = cellWidth.length();
}
if (computeDz)
{
cvf::Vec3d cellWidth = cell.faceCenter(cvf::StructGridInterface::NEG_K) - cell.faceCenter(cvf::StructGridInterface::POS_K);
cvf::Vec3d cellWidth =
cell.faceCenter(cvf::StructGridInterface::NEG_K) - cell.faceCenter(cvf::StructGridInterface::POS_K);
dz[0][cellIdx] = cellWidth.length();
}
@@ -1572,8 +1619,11 @@ void RigCaseCellResultsData::computeDepthRelatedResults()
namespace RigTransmissibilityCalcTools
{
void calculateConnectionGeometry(const RigCell& c1, const RigCell& c2, const std::vector<cvf::Vec3d>& nodes,
cvf::StructGridInterface::FaceType faceId, cvf::Vec3d* faceAreaVec)
void calculateConnectionGeometry(const RigCell& c1,
const RigCell& c2,
const std::vector<cvf::Vec3d>& nodes,
cvf::StructGridInterface::FaceType faceId,
cvf::Vec3d* faceAreaVec)
{
CVF_TIGHT_ASSERT(faceAreaVec);
@@ -1586,8 +1636,7 @@ void calculateConnectionGeometry(const RigCell& c1, const RigCell& c2, const std
c1.faceIndices(faceId, &face1);
c2.faceIndices(cvf::StructGridInterface::oppositeFace(faceId), &face2);
bool foundOverlap = cvf::GeometryTools::calculateOverlapPolygonOfTwoQuads(
&polygon,
bool foundOverlap = cvf::GeometryTools::calculateOverlapPolygonOfTwoQuads(&polygon,
&intersections,
(cvf::EdgeIntersectStorage<size_t>*)nullptr,
cvf::wrapArrayConst(&nodes),
@@ -1595,7 +1644,6 @@ void calculateConnectionGeometry(const RigCell& c1, const RigCell& c2, const std
face2.data(),
1e-6);
if (foundOverlap)
{
std::vector<cvf::Vec3d> realPolygon;
@@ -1611,9 +1659,7 @@ void calculateConnectionGeometry(const RigCell& c1, const RigCell& c2, const std
// Polygon area vector
*faceAreaVec = cvf::GeometryTools::polygonAreaNormal3D(realPolygon);
}
}
//--------------------------------------------------------------------------------------------------
@@ -1661,7 +1707,7 @@ size_t reservoirActiveCellIndex(const RigActiveCellInfo* activeCellinfo, size_t
{
return activeCellinfo->cellResultIndex(reservoirCellIndex);
}
}
} // namespace RigTransmissibilityCalcTools
using namespace RigTransmissibilityCalcTools;
@@ -1790,7 +1836,6 @@ void RigCaseCellResultsData::computeRiTransComponent(const QString& riTransCompo
const RigFault* fault = grid->mainGrid()->findFaultFromCellIndexAndCellFace(nativeResvCellIndex, faceId);
bool isOnFault = fault;
cvf::Vec3d faceAreaVec;
cvf::Vec3d faceCenter;
@@ -1800,7 +1845,6 @@ void RigCaseCellResultsData::computeRiTransComponent(const QString& riTransCompo
}
else
{
faceAreaVec = nativeCell.faceNormalWithAreaLenght(faceId);
}
@@ -1828,7 +1872,8 @@ void RigCaseCellResultsData::computeRiTransComponent(const QString& riTransCompo
// Neighbor cell half cell transm
{
cvf::Vec3d centerToFace = neighborCell.faceCenter(cvf::StructGridInterface::oppositeFace(faceId)) - neighborCell.center();
cvf::Vec3d centerToFace =
neighborCell.faceCenter(cvf::StructGridInterface::oppositeFace(faceId)) - neighborCell.center();
double perm = permResults[neighborCellPermResIdx];
@@ -1844,7 +1889,6 @@ void RigCaseCellResultsData::computeRiTransComponent(const QString& riTransCompo
riTransResults[tranResIdx] = newtran(cdarchy, 1.0, halfCellTrans, neighborHalfCellTrans);
}
}
}
@@ -1853,7 +1897,8 @@ void RigCaseCellResultsData::computeRiTransComponent(const QString& riTransCompo
//--------------------------------------------------------------------------------------------------
void RigCaseCellResultsData::computeNncCombRiTrans()
{
size_t riCombTransScalarResultIndex = this->findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::combinedRiTranResultName());
size_t riCombTransScalarResultIndex =
this->findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::combinedRiTranResultName());
if (m_ownerMainGrid->nncData()->staticConnectionScalarResult(riCombTransScalarResultIndex)) return;
double cdarchy = darchysValue();
@@ -1873,7 +1918,8 @@ void RigCaseCellResultsData::computeNncCombRiTrans()
std::vector<double>& permXResults = this->cellScalarResults(permXResultIdx)[0];
std::vector<double>& permYResults = this->cellScalarResults(permYResultIdx)[0];
std::vector<double>& permZResults = this->cellScalarResults(permZResultIdx)[0];
std::vector<double> & riCombTransResults = m_ownerMainGrid->nncData()->makeStaticConnectionScalarResult(RigNNCData::propertyNameRiCombTrans());
std::vector<double>& riCombTransResults =
m_ownerMainGrid->nncData()->makeStaticConnectionScalarResult(RigNNCData::propertyNameRiCombTrans());
m_ownerMainGrid->nncData()->setScalarResultIndex(RigNNCData::propertyNameRiCombTrans(), riCombTransScalarResultIndex);
std::vector<double>* ntgResults = nullptr;
@@ -1939,7 +1985,8 @@ void RigCaseCellResultsData::computeNncCombRiTrans()
permIdxFunc = permZIdxFunc;
permResults = &permZResults;
break;
default: break;
default:
break;
}
if (!permIdxFunc) continue;
@@ -1952,15 +1999,13 @@ void RigCaseCellResultsData::computeNncCombRiTrans()
size_t neighborCellPermResIdx = (*permIdxFunc)(activeCellInfo, neighborResvCellIdx);
if (neighborCellPermResIdx == cvf::UNDEFINED_SIZE_T) continue;
const RigCell& nativeCell = m_ownerMainGrid->globalCellArray()[nativeResvCellIndex];
const RigCell& neighborCell = m_ownerMainGrid->globalCellArray()[neighborResvCellIdx];
// Connection geometry
cvf::Vec3d faceAreaVec = cvf::Vec3d::ZERO;;
cvf::Vec3d faceCenter = cvf::Vec3d::ZERO;;
cvf::Vec3d faceAreaVec = cvf::Vec3d::ZERO;
cvf::Vec3d faceCenter = cvf::Vec3d::ZERO;
// Polygon center
const std::vector<cvf::Vec3d>& realPolygon = nncConnections[connIdx].m_polygon;
@@ -1998,7 +2043,8 @@ void RigCaseCellResultsData::computeNncCombRiTrans()
// Neighbor cell half cell transm
{
cvf::Vec3d centerToFace = neighborCell.faceCenter(cvf::StructGridInterface::oppositeFace(faceId)) - neighborCell.center();
cvf::Vec3d centerToFace =
neighborCell.faceCenter(cvf::StructGridInterface::oppositeFace(faceId)) - neighborCell.center();
double perm = (*permResults)[neighborCellPermResIdx];
@@ -2015,10 +2061,8 @@ void RigCaseCellResultsData::computeNncCombRiTrans()
double newtranTemp = newtran(cdarchy, 1.0, halfCellTrans, neighborHalfCellTrans);
riCombTransResults[connIdx] = newtranTemp;
}
}
double riMult(double transResults, double riTransResults)
{
if (transResults == HUGE_VAL || riTransResults == HUGE_VAL) return HUGE_VAL;
@@ -2034,7 +2078,6 @@ double riMult(double transResults, double riTransResults)
return HUGE_VAL;
}
double result = transResults / riTransResults;
return result;
@@ -2108,15 +2151,21 @@ void RigCaseCellResultsData::computeRiMULTComponent(const QString& riMultCompNam
//--------------------------------------------------------------------------------------------------
void RigCaseCellResultsData::computeNncCombRiMULT()
{
size_t riCombMultScalarResultIndex = this->findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::combinedRiMultResultName());
size_t riCombTransScalarResultIndex = this->findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::combinedRiTranResultName());
size_t combTransScalarResultIndex = this->findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::combinedTransmissibilityResultName());
size_t riCombMultScalarResultIndex =
this->findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::combinedRiMultResultName());
size_t riCombTransScalarResultIndex =
this->findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::combinedRiTranResultName());
size_t combTransScalarResultIndex =
this->findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::combinedTransmissibilityResultName());
if (m_ownerMainGrid->nncData()->staticConnectionScalarResult(riCombMultScalarResultIndex)) return;
std::vector<double> & riMultResults = m_ownerMainGrid->nncData()->makeStaticConnectionScalarResult(RigNNCData::propertyNameRiCombMult());
const std::vector<double> * riTransResults = m_ownerMainGrid->nncData()->staticConnectionScalarResult(riCombTransScalarResultIndex);
const std::vector<double> * transResults = m_ownerMainGrid->nncData()->staticConnectionScalarResult(combTransScalarResultIndex);
std::vector<double>& riMultResults =
m_ownerMainGrid->nncData()->makeStaticConnectionScalarResult(RigNNCData::propertyNameRiCombMult());
const std::vector<double>* riTransResults =
m_ownerMainGrid->nncData()->staticConnectionScalarResult(riCombTransScalarResultIndex);
const std::vector<double>* transResults =
m_ownerMainGrid->nncData()->staticConnectionScalarResult(combTransScalarResultIndex);
m_ownerMainGrid->nncData()->setScalarResultIndex(RigNNCData::propertyNameRiCombMult(), riCombMultScalarResultIndex);
for (size_t nncConIdx = 0; nncConIdx < riMultResults.size(); ++nncConIdx)
@@ -2230,7 +2279,6 @@ void RigCaseCellResultsData::computeRiTRANSbyAreaComponent(const QString& riTran
riTransByAreaResults[nativeCellResValIdx] = transCompValue / areaOfOverlap;
}
}
}
@@ -2239,14 +2287,18 @@ void RigCaseCellResultsData::computeRiTRANSbyAreaComponent(const QString& riTran
//--------------------------------------------------------------------------------------------------
void RigCaseCellResultsData::computeNncCombRiTRANSbyArea()
{
size_t riCombTransByAreaScResIdx = this->findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::combinedRiAreaNormTranResultName());
size_t combTransScalarResultIndex = this->findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::combinedTransmissibilityResultName());
size_t riCombTransByAreaScResIdx =
this->findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::combinedRiAreaNormTranResultName());
size_t combTransScalarResultIndex =
this->findScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::combinedTransmissibilityResultName());
if (m_ownerMainGrid->nncData()->staticConnectionScalarResult(riCombTransByAreaScResIdx)) return;
std::vector<double> & riAreaNormTransResults = m_ownerMainGrid->nncData()->makeStaticConnectionScalarResult(RigNNCData::propertyNameRiCombTransByArea());
std::vector<double>& riAreaNormTransResults =
m_ownerMainGrid->nncData()->makeStaticConnectionScalarResult(RigNNCData::propertyNameRiCombTransByArea());
m_ownerMainGrid->nncData()->setScalarResultIndex(RigNNCData::propertyNameRiCombTransByArea(), riCombTransByAreaScResIdx);
const std::vector<double> * transResults = m_ownerMainGrid->nncData()->staticConnectionScalarResult(combTransScalarResultIndex);
const std::vector<double>* transResults =
m_ownerMainGrid->nncData()->staticConnectionScalarResult(combTransScalarResultIndex);
const std::vector<RigConnection>& connections = m_ownerMainGrid->nncData()->connections();
@@ -2265,7 +2317,8 @@ void RigCaseCellResultsData::computeNncCombRiTRANSbyArea()
//--------------------------------------------------------------------------------------------------
void RigCaseCellResultsData::computeCompletionTypeForTimeStep(size_t timeStep)
{
size_t completionTypeResultIndex = this->findScalarResultIndex(RiaDefines::DYNAMIC_NATIVE, RiaDefines::completionTypeResultName());
size_t completionTypeResultIndex =
this->findScalarResultIndex(RiaDefines::DYNAMIC_NATIVE, RiaDefines::completionTypeResultName());
if (this->cellScalarResults(completionTypeResultIndex).size() < this->maxTimeStepCount())
{
@@ -2291,7 +2344,6 @@ void RigCaseCellResultsData::computeCompletionTypeForTimeStep(size_t timeStep)
RimCompletionCellIntersectionCalc::calculateCompletionTypeResult(eclipseCase, completionTypeResult, timeStep);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -2321,7 +2373,8 @@ void RigCaseCellResultsData::computeMobilePV()
}
swcrResults = RigCaseCellResultsData::getResultIndexableStaticResult(this->activeCellInfo(), this, "SWCR", swcrDataTemp);
multpvResults = RigCaseCellResultsData::getResultIndexableStaticResult(this->activeCellInfo(), this, "MULTPV", multpvDataTemp);
multpvResults =
RigCaseCellResultsData::getResultIndexableStaticResult(this->activeCellInfo(), this, "MULTPV", multpvDataTemp);
size_t mobPVIdx = this->findOrCreateScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::mobilePoreVolumeName(), false);
@@ -2365,7 +2418,6 @@ void RigCaseCellResultsData::setReaderInterface(RifReaderInterface* readerInterf
m_readerInterface = readerInterface;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -2437,4 +2489,3 @@ void RigCaseCellResultsData::assignValuesToTemporaryLgrs(std::vector<double>& va
}
}
}
@@ -50,9 +50,9 @@ public:
void setHdf5Filename(const QString& hdf5SourSimFilename );
void setMainGrid(RigMainGrid* ownerGrid);
void setActiveCellInfo(RigActiveCellInfo* activeCellInfo) { m_activeCellInfo = activeCellInfo;}
RigActiveCellInfo* activeCellInfo() { return m_activeCellInfo;}
const RigActiveCellInfo* activeCellInfo() const { return m_activeCellInfo;}
void setActiveCellInfo(RigActiveCellInfo* activeCellInfo);
RigActiveCellInfo* activeCellInfo();
const RigActiveCellInfo* activeCellInfo() const;
// Max and min values of the results
void recalculateStatistics(size_t scalarResultIndex);
@@ -125,7 +125,7 @@ public:
std::vector<double> &activeCellsResultsTempContainer);
public:
const std::vector<RigEclipseResultInfo>& infoForEachResultIndex() { return m_resultInfos;}
const std::vector<RigEclipseResultInfo>& infoForEachResultIndex();
bool mustBeCalculated(size_t scalarResultIndex) const;
void setMustBeCalculated(size_t scalarResultIndex);