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)
|
RigCombTransResultAccessor::RigCombTransResultAccessor(const RigGridBase* grid)
|
||||||
: m_grid(grid)
|
: m_grid(grid)
|
||||||
{
|
{
|
||||||
m_resultAccessObjects.resize(6);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
/// Only sensible to provide the positive values, as the negative ones will never be used.
|
/// 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
|
/// The negative faces gets their value from the neighbor cell in that direction
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RigCombTransResultAccessor::setDataAccessObjectForFace(cvf::StructGridInterface::FaceType faceId, RigResultAccessor* resultAccessObject)
|
void RigCombTransResultAccessor::setTransResultAccessors(RigResultAccessor* xTransAccessor,
|
||||||
{
|
RigResultAccessor* yTransAccessor,
|
||||||
CVF_ASSERT(faceId == cvf::StructGridInterface::POS_I || faceId == cvf::StructGridInterface::POS_J || faceId == cvf::StructGridInterface::POS_K );
|
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
|
double RigCombTransResultAccessor::cellScalar(size_t localCellIndex) const
|
||||||
{
|
{
|
||||||
|
CVF_TIGHT_ASSERT(false);
|
||||||
|
|
||||||
// TODO: How to handle when we get here?
|
return HUGE_VAL;
|
||||||
CVF_ASSERT(false);
|
|
||||||
|
|
||||||
return cvf::UNDEFINED_DOUBLE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -64,72 +65,66 @@ double RigCombTransResultAccessor::cellFaceScalar(size_t localCellIndex, cvf::St
|
|||||||
{
|
{
|
||||||
case cvf::StructGridInterface::POS_I:
|
case cvf::StructGridInterface::POS_I:
|
||||||
{
|
{
|
||||||
const RigResultAccessor* resultAccessObj = m_resultAccessObjects.at(cvf::StructGridInterface::POS_I);
|
if (m_xTransAccessor.notNull())
|
||||||
if (resultAccessObj)
|
|
||||||
{
|
{
|
||||||
return resultAccessObj->cellScalar(localCellIndex);
|
return m_xTransAccessor->cellScalar(localCellIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case cvf::StructGridInterface::NEG_I:
|
case cvf::StructGridInterface::NEG_I:
|
||||||
{
|
{
|
||||||
const RigResultAccessor* resultAccessObj = m_resultAccessObjects.at(cvf::StructGridInterface::POS_I);
|
if (m_xTransAccessor.notNull())
|
||||||
if (resultAccessObj)
|
|
||||||
{
|
{
|
||||||
size_t i, j, k, neighborGridCellIdx;
|
size_t i, j, k, neighborGridCellIdx;
|
||||||
m_grid->ijkFromCellIndex(localCellIndex, &i, &j, &k);
|
m_grid->ijkFromCellIndex(localCellIndex, &i, &j, &k);
|
||||||
|
|
||||||
if (m_grid->cellIJKNeighbor(i, j, k, cvf::StructGridInterface::NEG_I, &neighborGridCellIdx))
|
if (m_grid->cellIJKNeighbor(i, j, k, cvf::StructGridInterface::NEG_I, &neighborGridCellIdx))
|
||||||
{
|
{
|
||||||
return resultAccessObj->cellScalar(neighborGridCellIdx);
|
return m_xTransAccessor->cellScalar(neighborGridCellIdx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case cvf::StructGridInterface::POS_J:
|
case cvf::StructGridInterface::POS_J:
|
||||||
{
|
{
|
||||||
const RigResultAccessor* resultAccessObj = m_resultAccessObjects.at(cvf::StructGridInterface::POS_J);
|
if (m_yTransAccessor.notNull())
|
||||||
if (resultAccessObj)
|
|
||||||
{
|
{
|
||||||
return resultAccessObj->cellScalar(localCellIndex);
|
return m_yTransAccessor->cellScalar(localCellIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case cvf::StructGridInterface::NEG_J:
|
case cvf::StructGridInterface::NEG_J:
|
||||||
{
|
{
|
||||||
const RigResultAccessor* resultAccessObj = m_resultAccessObjects.at(cvf::StructGridInterface::POS_J);
|
if (m_yTransAccessor.notNull())
|
||||||
if (resultAccessObj)
|
|
||||||
{
|
{
|
||||||
size_t i, j, k, neighborGridCellIdx;
|
size_t i, j, k, neighborGridCellIdx;
|
||||||
m_grid->ijkFromCellIndex(localCellIndex, &i, &j, &k);
|
m_grid->ijkFromCellIndex(localCellIndex, &i, &j, &k);
|
||||||
|
|
||||||
if (m_grid->cellIJKNeighbor(i, j, k, cvf::StructGridInterface::NEG_J, &neighborGridCellIdx))
|
if (m_grid->cellIJKNeighbor(i, j, k, cvf::StructGridInterface::NEG_J, &neighborGridCellIdx))
|
||||||
{
|
{
|
||||||
return resultAccessObj->cellScalar(neighborGridCellIdx);
|
return m_yTransAccessor->cellScalar(neighborGridCellIdx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case cvf::StructGridInterface::POS_K:
|
case cvf::StructGridInterface::POS_K:
|
||||||
{
|
{
|
||||||
const RigResultAccessor* resultAccessObj = m_resultAccessObjects.at(cvf::StructGridInterface::POS_K);
|
if (m_zTransAccessor.notNull())
|
||||||
if (resultAccessObj)
|
|
||||||
{
|
{
|
||||||
return resultAccessObj->cellScalar(localCellIndex);
|
return m_zTransAccessor->cellScalar(localCellIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case cvf::StructGridInterface::NEG_K:
|
case cvf::StructGridInterface::NEG_K:
|
||||||
{
|
{
|
||||||
const RigResultAccessor* resultAccessObj = m_resultAccessObjects.at(cvf::StructGridInterface::POS_K);
|
if (m_zTransAccessor.notNull())
|
||||||
if (resultAccessObj)
|
|
||||||
{
|
{
|
||||||
size_t i, j, k, neighborGridCellIdx;
|
size_t i, j, k, neighborGridCellIdx;
|
||||||
m_grid->ijkFromCellIndex(localCellIndex, &i, &j, &k);
|
m_grid->ijkFromCellIndex(localCellIndex, &i, &j, &k);
|
||||||
|
|
||||||
if (m_grid->cellIJKNeighbor(i, j, k, cvf::StructGridInterface::NEG_K, &neighborGridCellIdx))
|
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:
|
public:
|
||||||
RigCombTransResultAccessor(const RigGridBase* grid);
|
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 cellScalar(size_t localCellIndex) const;
|
||||||
virtual double cellFaceScalar(size_t localCellIndex, cvf::StructGridInterface::FaceType faceId) const;
|
virtual double cellFaceScalar(size_t localCellIndex, cvf::StructGridInterface::FaceType faceId) const;
|
||||||
|
|
||||||
private:
|
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;
|
const RigGridBase* m_grid;
|
||||||
};
|
};
|
||||||
|
@ -43,7 +43,7 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createNativeResultAccessor
|
|||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||||
size_t timeStepIndex,
|
size_t timeStepIndex,
|
||||||
QString& uiResultName)
|
const QString& uiResultName)
|
||||||
{
|
{
|
||||||
CVF_ASSERT(gridIndex < eclipseCase->gridCount());
|
CVF_ASSERT(gridIndex < eclipseCase->gridCount());
|
||||||
CVF_ASSERT(eclipseCase);
|
CVF_ASSERT(eclipseCase);
|
||||||
@ -102,7 +102,7 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createResultAccessor(RigCa
|
|||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||||
size_t timeStepIndex,
|
size_t timeStepIndex,
|
||||||
QString& uiResultName)
|
const QString& uiResultName)
|
||||||
{
|
{
|
||||||
CVF_ASSERT(gridIndex < eclipseCase->gridCount());
|
CVF_ASSERT(gridIndex < eclipseCase->gridCount());
|
||||||
CVF_ASSERT(eclipseCase);
|
CVF_ASSERT(eclipseCase);
|
||||||
@ -118,38 +118,13 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createResultAccessor(RigCa
|
|||||||
}
|
}
|
||||||
else if (uiResultName == RimDefines::combinedTransmissibilityResultName())
|
else if (uiResultName == RimDefines::combinedTransmissibilityResultName())
|
||||||
{
|
{
|
||||||
// TODO
|
|
||||||
// Taken from RivTransmissibilityColorMapper::updateCombinedTransmissibilityTextureCoordinates
|
|
||||||
//
|
|
||||||
|
|
||||||
cvf::ref<RigCombTransResultAccessor> cellFaceAccessObject = new RigCombTransResultAccessor(grid);
|
cvf::ref<RigCombTransResultAccessor> cellFaceAccessObject = new RigCombTransResultAccessor(grid);
|
||||||
|
|
||||||
{
|
cvf::ref<RigResultAccessor> xTransAccessor = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, "TRANX");
|
||||||
QString resultName = "TRANX";
|
cvf::ref<RigResultAccessor> yTransAccessor = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, "TRANY");
|
||||||
cvf::ref<RigResultAccessor> nativeAccessObject = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, resultName);
|
cvf::ref<RigResultAccessor> zTransAccessor = RigResultAccessorFactory::createNativeResultAccessor(eclipseCase, gridIndex, porosityModel, timeStepIndex, "TRANZ");
|
||||||
if (nativeAccessObject.notNull())
|
|
||||||
{
|
|
||||||
cellFaceAccessObject->setDataAccessObjectForFace(cvf::StructGridInterface::POS_I, nativeAccessObject.p());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
cellFaceAccessObject->setTransResultAccessors(xTransAccessor.p(), yTransAccessor.p(), zTransAccessor.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());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return cellFaceAccessObject;
|
return cellFaceAccessObject;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ public:
|
|||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||||
size_t timeStepIndex,
|
size_t timeStepIndex,
|
||||||
QString& uiResultName);
|
const QString& uiResultName);
|
||||||
|
|
||||||
|
|
||||||
// TO BE DELETED
|
// TO BE DELETED
|
||||||
@ -52,7 +52,7 @@ private:
|
|||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||||
size_t timeStepIndex,
|
size_t timeStepIndex,
|
||||||
QString& resultName);
|
const QString& resultName);
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user