#1987 Time Step Filtering: Support dynamic NNC data time step filtering

This commit is contained in:
Rebecca Cox 2017-10-19 09:57:10 +02:00
parent b38534b178
commit adf55ec762
10 changed files with 36 additions and 11 deletions

View File

@ -666,8 +666,16 @@ void RivFaultPartMgr::updateNNCColors(size_t timeStepIndex, RimEclipseCellColors
RiaDefines::ResultCatType resultType = cellResultColors->resultType();
const cvf::ScalarMapper* mapper = cellResultColors->legendConfig()->scalarMapper();
m_NNCGenerator->textureCoordinates(m_NNCTextureCoords.p(), mapper, resultType, scalarSetIndex, timeStepIndex);
if (eclipseView)
{
RimEclipseCase* eclipseCase = eclipseView->eclipseCase();
if (eclipseCase)
{
size_t nativeTimeStepIndex = eclipseCase->uiToNativeTimeStepIndex(timeStepIndex);
m_NNCGenerator->textureCoordinates(m_NNCTextureCoords.p(), mapper, resultType, scalarSetIndex, nativeTimeStepIndex);
}
}
cvf::ref<cvf::Effect> nncEffect;

View File

@ -149,7 +149,7 @@ void RivNNCGeometryGenerator::textureCoordinates(cvf::Vec2fArray* textureCoords,
const cvf::ScalarMapper* mapper,
RiaDefines::ResultCatType resultType,
size_t scalarResultIndex,
size_t timeStepIndex) const
size_t nativeTimeStepIndex) const
{
size_t numVertices = m_vertices->size();
@ -162,11 +162,11 @@ void RivNNCGeometryGenerator::textureCoordinates(cvf::Vec2fArray* textureCoords,
}
else if (resultType == RiaDefines::DYNAMIC_NATIVE)
{
nncResultVals = m_nncData->dynamicConnectionScalarResult(scalarResultIndex, timeStepIndex);
nncResultVals = m_nncData->dynamicConnectionScalarResult(scalarResultIndex, nativeTimeStepIndex);
}
else if (resultType == RiaDefines::GENERATED)
{
nncResultVals = m_nncData->generatedConnectionScalarResult(scalarResultIndex, timeStepIndex);
nncResultVals = m_nncData->generatedConnectionScalarResult(scalarResultIndex, nativeTimeStepIndex);
}
if (!nncResultVals)

View File

@ -51,7 +51,7 @@ public:
const cvf::ScalarMapper* mapper,
RiaDefines::ResultCatType resultType,
size_t scalarResultIndex,
size_t timeStepIndex) const;
size_t nativeTimeStepIndex) const;
// Mapping between cells and geometry
cvf::ref<cvf::Array<size_t> > triangleToNNCIndex() const;

View File

@ -66,6 +66,16 @@ cvf::Vec3d RimCase::displayModelOffset() const
return cvf::Vec3d::ZERO;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RimCase::uiToNativeTimeStepIndex(size_t uiTimeStepIndex)
{
std::vector<size_t> nativeTimeIndices = m_timeStepFilter->filteredNativeTimeStepIndices();
return nativeTimeIndices.at(uiTimeStepIndex);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -66,6 +66,8 @@ public:
virtual double characteristicCellSize() const = 0;
size_t uiToNativeTimeStepIndex(size_t uiTimeStepIndex);
protected:
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
private:

View File

@ -171,7 +171,7 @@ bool RimEclipseResultCase::importGridAndResultMetaData(bool showTimeStepFilter)
readerEclipseOutput->setFileDataAccess(restartDataAccess.p());
}
readerEclipseOutput->setTimeStepFilter(m_timeStepFilter->selectedTimeStepIndices());
readerEclipseOutput->setTimeStepFilter(m_timeStepFilter->filteredNativeTimeStepIndices());
cvf::ref<RigEclipseCaseData> eclipseCase = new RigEclipseCaseData(this);
if (!readerEclipseOutput->open(caseFileName(), eclipseCase.p()))

View File

@ -106,7 +106,7 @@ void RimTimeStepFilter::clearTimeStepsFromFile()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<size_t> RimTimeStepFilter::selectedTimeStepIndices() const
std::vector<size_t> RimTimeStepFilter::filteredNativeTimeStepIndices() const
{
std::vector<size_t> indices;

View File

@ -50,7 +50,7 @@ public:
void setTimeStepsFromFile(const std::vector<QDateTime>& timeSteps);
void clearTimeStepsFromFile();
std::vector<size_t> selectedTimeStepIndices() const;
std::vector<size_t> filteredNativeTimeStepIndices() const;
private:
QString filteredTimeStepsAsText() const;

View File

@ -149,8 +149,9 @@ RigNumberOfFloodedPoreVolumesCalculator::RigNumberOfFloodedPoreVolumesCalculator
}
flowrateKatAllTimeSteps.push_back(flowrateK);
size_t nativeTimeStepIndex = caseToApply->uiToNativeTimeStepIndex(timeStep);
const std::vector<double>* connectionFlowrate = nncData->dynamicConnectionScalarResultByName(nncConnectionProperty,
timeStep);
nativeTimeStepIndex);
flowrateNNCatAllTimeSteps.push_back(connectionFlowrate);

View File

@ -356,7 +356,11 @@ QString RiuResultTextBuilder::nncResultText()
}
else if (resultType == RiaDefines::DYNAMIC_NATIVE)
{
nncValues = nncData->dynamicConnectionScalarResult(scalarResultIdx, m_timeStepIndex);
if (m_reservoirView.notNull() && m_reservoirView->eclipseCase())
{
size_t nativeTimeStep = m_reservoirView->eclipseCase()->uiToNativeTimeIndex(m_timeStepIndex);
nncValues = nncData->dynamicConnectionScalarResult(scalarResultIdx, nativeTimeStep);
}
}
if (nncValues)
{