Added riMULTXYZ to statistics and result factory

This commit is contained in:
Magne Sjaastad 2014-08-19 13:20:44 +02:00
parent be224149f0
commit a2f4887d56
2 changed files with 76 additions and 17 deletions

View File

@ -243,6 +243,38 @@ size_t RigCaseCellResultsData::addEmptyScalarResult(RimDefines::ResultCatType ty
cvf::ref<RigStatisticsDataCache> dataCache = new RigStatisticsDataCache(calc.p());
m_statisticsDataCache.push_back(dataCache.p());
}
else if (resultName == RimDefines::combinedMultResultName())
{
cvf::ref<RigMultipleDatasetStatCalc> calc = new RigMultipleDatasetStatCalc();
{
size_t scalarIdx = findScalarResultIndex(RimDefines::STATIC_NATIVE, "MULTX");
if (scalarIdx != cvf::UNDEFINED_SIZE_T) calc->addStatisticsCalculator(new RigNativeStatCalc(this, scalarIdx));
}
{
size_t scalarIdx = findScalarResultIndex(RimDefines::STATIC_NATIVE, "MULTX-");
if (scalarIdx != cvf::UNDEFINED_SIZE_T) calc->addStatisticsCalculator(new RigNativeStatCalc(this, scalarIdx));
}
{
size_t scalarIdx = findScalarResultIndex(RimDefines::STATIC_NATIVE, "MULTY");
if (scalarIdx != cvf::UNDEFINED_SIZE_T) calc->addStatisticsCalculator(new RigNativeStatCalc(this, scalarIdx));
}
{
size_t scalarIdx = findScalarResultIndex(RimDefines::STATIC_NATIVE, "MULTY-");
if (scalarIdx != cvf::UNDEFINED_SIZE_T) calc->addStatisticsCalculator(new RigNativeStatCalc(this, scalarIdx));
}
{
size_t scalarIdx = findScalarResultIndex(RimDefines::STATIC_NATIVE, "MULTZ");
if (scalarIdx != cvf::UNDEFINED_SIZE_T) calc->addStatisticsCalculator(new RigNativeStatCalc(this, scalarIdx));
}
{
size_t scalarIdx = findScalarResultIndex(RimDefines::STATIC_NATIVE, "MULTZ-");
if (scalarIdx != cvf::UNDEFINED_SIZE_T) calc->addStatisticsCalculator(new RigNativeStatCalc(this, scalarIdx));
}
cvf::ref<RigStatisticsDataCache> dataCache = new RigStatisticsDataCache(calc.p());
m_statisticsDataCache.push_back(dataCache.p());
}
else
{
cvf::ref<RigNativeStatCalc> calc = new RigNativeStatCalc(this, scalarResultIndex);
@ -476,13 +508,25 @@ void RigCaseCellResultsData::setMustBeCalculated(size_t scalarResultIndex)
//--------------------------------------------------------------------------------------------------
void RigCaseCellResultsData::createCombinedTransmissibilityResult()
{
size_t combinedTransmissibilityIndex = findScalarResultIndex(RimDefines::STATIC_NATIVE, RimDefines::combinedTransmissibilityResultName());
if (combinedTransmissibilityIndex != cvf::UNDEFINED_SIZE_T) return;
{
size_t combinedTransmissibilityIndex = findScalarResultIndex(RimDefines::STATIC_NATIVE, RimDefines::combinedTransmissibilityResultName());
if (combinedTransmissibilityIndex == cvf::UNDEFINED_SIZE_T)
{
size_t tranX, tranY, tranZ;
if (findTransmissibilityResults(tranX, tranY, tranZ))
{
addStaticScalarResult(RimDefines::STATIC_NATIVE, RimDefines::combinedTransmissibilityResultName(), false, 0);
}
}
}
size_t tranX, tranY, tranZ;
if (!findTransmissibilityResults(tranX, tranY, tranZ)) return;
addStaticScalarResult(RimDefines::STATIC_NATIVE, RimDefines::combinedTransmissibilityResultName(), false, 0);
{
size_t combinedMultIndex = findScalarResultIndex(RimDefines::STATIC_NATIVE, RimDefines::combinedMultResultName());
if (combinedMultIndex == cvf::UNDEFINED_SIZE_T)
{
addStaticScalarResult(RimDefines::STATIC_NATIVE, RimDefines::combinedMultResultName(), false, 0);
}
}
}
//--------------------------------------------------------------------------------------------------

View File

@ -18,23 +18,23 @@
#include "RigResultAccessorFactory.h"
#include "RigResultAccessor.h"
#include "RigActiveCellInfo.h"
#include "RigActiveCellsResultAccessor.h"
#include "RigAllGridCellsResultAccessor.h"
#include "cvfLibCore.h"
#include "cvfBase.h"
#include "cvfObject.h"
#include "cvfAssert.h"
#include "RigMainGrid.h"
#include "RigCaseCellResultsData.h"
#include "RigActiveCellInfo.h"
#include "RigGridBase.h"
#include "RigCaseData.h"
#include <math.h>
#include "RigCombMultResultAccessor.h"
#include "RigCombTransResultAccessor.h"
#include "RigGridBase.h"
#include "RigMainGrid.h"
#include "RigResultAccessor.h"
#include "cvfAssert.h"
#include "cvfBase.h"
#include "cvfLibCore.h"
#include "cvfObject.h"
#include <math.h>
//--------------------------------------------------------------------------------------------------
///
@ -64,6 +64,21 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createResultAccessor(RigCa
return cellFaceAccessObject;
}
else if (uiResultName == RimDefines::combinedMultResultName())
{
cvf::ref<RigCombMultResultAccessor> cellFaceAccessObject = new RigCombMultResultAccessor(grid);
cvf::ref<RigResultAccessor> multXPos = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, "MULTX");
cvf::ref<RigResultAccessor> multXNeg = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, "MULTX-");
cvf::ref<RigResultAccessor> multYPos = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, "MULTY");
cvf::ref<RigResultAccessor> multYNeg = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, "MULTY-");
cvf::ref<RigResultAccessor> multZPos = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, "MULTZ");
cvf::ref<RigResultAccessor> multZNeg = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, "MULTZ-");
cellFaceAccessObject->setMultResultAccessors(multXPos.p(), multXNeg.p(), multYPos.p(), multYNeg.p(), multZPos.p(), multZNeg.p());
return cellFaceAccessObject;
}
return RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, uiResultName);
}