mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-01 03:37:15 -06:00
#1987 Time Step Filtering: Support dynamic NNC data time step filtering
This commit is contained in:
parent
b38534b178
commit
adf55ec762
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -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:
|
||||
|
@ -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()))
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user