mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Trimmed CombTransResultAccessor interface
setTransResultAccessors
This commit is contained in:
parent
b4d8067a74
commit
0f26b6e22f
@ -29,18 +29,21 @@
|
||||
RigCombTransResultAccessor::RigCombTransResultAccessor(const RigGridBase* grid)
|
||||
: m_grid(grid)
|
||||
{
|
||||
m_resultAccessObjects.resize(6);
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Only sensible to provide the positive values, as the negative ones will never be used.
|
||||
/// The negative faces gets their value from the neighbor cell in that direction
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigCombTransResultAccessor::setDataAccessObjectForFace(cvf::StructGridInterface::FaceType faceId, RigResultAccessor* resultAccessObject)
|
||||
{
|
||||
CVF_ASSERT(faceId == cvf::StructGridInterface::POS_I || faceId == cvf::StructGridInterface::POS_J || faceId == cvf::StructGridInterface::POS_K );
|
||||
void RigCombTransResultAccessor::setTransResultAccessors(RigResultAccessor* xTransAccessor,
|
||||
RigResultAccessor* yTransAccessor,
|
||||
RigResultAccessor* zTransAccessor)
|
||||
|
||||
m_resultAccessObjects[faceId] = resultAccessObject;
|
||||
{
|
||||
m_xTransAccessor = xTransAccessor;
|
||||
m_yTransAccessor = yTransAccessor;
|
||||
m_zTransAccessor = zTransAccessor;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -48,11 +51,9 @@ void RigCombTransResultAccessor::setDataAccessObjectForFace(cvf::StructGridInter
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigCombTransResultAccessor::cellScalar(size_t localCellIndex) const
|
||||
{
|
||||
CVF_TIGHT_ASSERT(false);
|
||||
|
||||
// TODO: How to handle when we get here?
|
||||
CVF_ASSERT(false);
|
||||
|
||||
return cvf::UNDEFINED_DOUBLE;
|
||||
return HUGE_VAL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -64,72 +65,66 @@ double RigCombTransResultAccessor::cellFaceScalar(size_t localCellIndex, cvf::St
|
||||
{
|
||||
case cvf::StructGridInterface::POS_I:
|
||||
{
|
||||
const RigResultAccessor* resultAccessObj = m_resultAccessObjects.at(cvf::StructGridInterface::POS_I);
|
||||
if (resultAccessObj)
|
||||
if (m_xTransAccessor.notNull())
|
||||
{
|
||||
return resultAccessObj->cellScalar(localCellIndex);
|
||||
return m_xTransAccessor->cellScalar(localCellIndex);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case cvf::StructGridInterface::NEG_I:
|
||||
{
|
||||
const RigResultAccessor* resultAccessObj = m_resultAccessObjects.at(cvf::StructGridInterface::POS_I);
|
||||
if (resultAccessObj)
|
||||
if (m_xTransAccessor.notNull())
|
||||
{
|
||||
size_t i, j, k, neighborGridCellIdx;
|
||||
m_grid->ijkFromCellIndex(localCellIndex, &i, &j, &k);
|
||||
|
||||
if (m_grid->cellIJKNeighbor(i, j, k, cvf::StructGridInterface::NEG_I, &neighborGridCellIdx))
|
||||
{
|
||||
return resultAccessObj->cellScalar(neighborGridCellIdx);
|
||||
return m_xTransAccessor->cellScalar(neighborGridCellIdx);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case cvf::StructGridInterface::POS_J:
|
||||
{
|
||||
const RigResultAccessor* resultAccessObj = m_resultAccessObjects.at(cvf::StructGridInterface::POS_J);
|
||||
if (resultAccessObj)
|
||||
if (m_yTransAccessor.notNull())
|
||||
{
|
||||
return resultAccessObj->cellScalar(localCellIndex);
|
||||
return m_yTransAccessor->cellScalar(localCellIndex);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case cvf::StructGridInterface::NEG_J:
|
||||
{
|
||||
const RigResultAccessor* resultAccessObj = m_resultAccessObjects.at(cvf::StructGridInterface::POS_J);
|
||||
if (resultAccessObj)
|
||||
if (m_yTransAccessor.notNull())
|
||||
{
|
||||
size_t i, j, k, neighborGridCellIdx;
|
||||
m_grid->ijkFromCellIndex(localCellIndex, &i, &j, &k);
|
||||
|
||||
if (m_grid->cellIJKNeighbor(i, j, k, cvf::StructGridInterface::NEG_J, &neighborGridCellIdx))
|
||||
{
|
||||
return resultAccessObj->cellScalar(neighborGridCellIdx);
|
||||
return m_yTransAccessor->cellScalar(neighborGridCellIdx);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case cvf::StructGridInterface::POS_K:
|
||||
{
|
||||
const RigResultAccessor* resultAccessObj = m_resultAccessObjects.at(cvf::StructGridInterface::POS_K);
|
||||
if (resultAccessObj)
|
||||
if (m_zTransAccessor.notNull())
|
||||
{
|
||||
return resultAccessObj->cellScalar(localCellIndex);
|
||||
return m_zTransAccessor->cellScalar(localCellIndex);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case cvf::StructGridInterface::NEG_K:
|
||||
{
|
||||
const RigResultAccessor* resultAccessObj = m_resultAccessObjects.at(cvf::StructGridInterface::POS_K);
|
||||
if (resultAccessObj)
|
||||
if (m_zTransAccessor.notNull())
|
||||
{
|
||||
size_t i, j, k, neighborGridCellIdx;
|
||||
m_grid->ijkFromCellIndex(localCellIndex, &i, &j, &k);
|
||||
|
||||
if (m_grid->cellIJKNeighbor(i, j, k, cvf::StructGridInterface::NEG_K, &neighborGridCellIdx))
|
||||
{
|
||||
return resultAccessObj->cellScalar(neighborGridCellIdx);
|
||||
return m_zTransAccessor->cellScalar(neighborGridCellIdx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,13 +33,18 @@ class RigCombTransResultAccessor : public RigResultAccessor
|
||||
public:
|
||||
RigCombTransResultAccessor(const RigGridBase* grid);
|
||||
|
||||
void setDataAccessObjectForFace(cvf::StructGridInterface::FaceType faceId, RigResultAccessor* resultAccessObject);
|
||||
void setTransResultAccessors(RigResultAccessor* xTransAccessor,
|
||||
RigResultAccessor* yTransAccessor,
|
||||
RigResultAccessor* zTransAccessor);
|
||||
|
||||
virtual double cellScalar(size_t localCellIndex) const;
|
||||
virtual double cellFaceScalar(size_t localCellIndex, cvf::StructGridInterface::FaceType faceId) const;
|
||||
|
||||
private:
|
||||
cvf::Collection<RigResultAccessor> m_resultAccessObjects;
|
||||
|
||||
|
||||
cvf::ref<RigResultAccessor> m_xTransAccessor;
|
||||
cvf::ref<RigResultAccessor> m_yTransAccessor;
|
||||
cvf::ref<RigResultAccessor> m_zTransAccessor;
|
||||
|
||||
const RigGridBase* m_grid;
|
||||
};
|
||||
|
@ -43,7 +43,7 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createNativeResultAccessor
|
||||
size_t gridIndex,
|
||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
QString& uiResultName)
|
||||
const QString& uiResultName)
|
||||
{
|
||||
CVF_ASSERT(gridIndex < eclipseCase->gridCount());
|
||||
CVF_ASSERT(eclipseCase);
|
||||
@ -102,7 +102,7 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createResultAccessor(RigCa
|
||||
size_t gridIndex,
|
||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
QString& uiResultName)
|
||||
const QString& uiResultName)
|
||||
{
|
||||
CVF_ASSERT(gridIndex < eclipseCase->gridCount());
|
||||
CVF_ASSERT(eclipseCase);
|
||||
@ -118,38 +118,13 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createResultAccessor(RigCa
|
||||
}
|
||||
else if (uiResultName == RimDefines::combinedTransmissibilityResultName())
|
||||
{
|
||||
// TODO
|
||||
// Taken from RivTransmissibilityColorMapper::updateCombinedTransmissibilityTextureCoordinates
|
||||
//
|
||||
|
||||
cvf::ref<RigCombTransResultAccessor> cellFaceAccessObject = new RigCombTransResultAccessor(grid);
|
||||
|
||||
{
|
||||
QString resultName = "TRANX";
|
||||
cvf::ref<RigResultAccessor> nativeAccessObject = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, resultName);
|
||||
if (nativeAccessObject.notNull())
|
||||
{
|
||||
cellFaceAccessObject->setDataAccessObjectForFace(cvf::StructGridInterface::POS_I, nativeAccessObject.p());
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
QString resultName = "TRANY";
|
||||
cvf::ref<RigResultAccessor> nativeAccessObject = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, resultName);
|
||||
if (nativeAccessObject.notNull())
|
||||
{
|
||||
cellFaceAccessObject->setDataAccessObjectForFace(cvf::StructGridInterface::POS_J, nativeAccessObject.p());
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
QString resultName = "TRANZ";
|
||||
cvf::ref<RigResultAccessor> nativeAccessObject = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, resultName);
|
||||
if (nativeAccessObject.notNull())
|
||||
{
|
||||
cellFaceAccessObject->setDataAccessObjectForFace(cvf::StructGridInterface::POS_K, nativeAccessObject.p());
|
||||
}
|
||||
}
|
||||
cvf::ref<RigResultAccessor> xTransAccessor = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, "TRANX");
|
||||
cvf::ref<RigResultAccessor> yTransAccessor = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, "TRANY");
|
||||
cvf::ref<RigResultAccessor> zTransAccessor = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, "TRANZ");
|
||||
|
||||
cellFaceAccessObject->setTransResultAccessors(xTransAccessor.p(), yTransAccessor.p(), zTransAccessor.p());
|
||||
|
||||
return cellFaceAccessObject;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public:
|
||||
size_t gridIndex,
|
||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
QString& uiResultName);
|
||||
const QString& uiResultName);
|
||||
|
||||
|
||||
// TO BE DELETED
|
||||
@ -52,7 +52,7 @@ private:
|
||||
size_t gridIndex,
|
||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
QString& resultName);
|
||||
const QString& resultName);
|
||||
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user