mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Bugfix : Allocate max timestep count when receiving data from Octave
This commit is contained in:
parent
ffbfb8bdf0
commit
103a9f4018
@ -416,6 +416,9 @@ public:
|
|||||||
if (scalarResultIndex != cvf::UNDEFINED_SIZE_T)
|
if (scalarResultIndex != cvf::UNDEFINED_SIZE_T)
|
||||||
{
|
{
|
||||||
scalarResultFrames = &(rimCase->results(m_porosityModelEnum)->cellResults()->cellScalarResults(scalarResultIndex));
|
scalarResultFrames = &(rimCase->results(m_porosityModelEnum)->cellResults()->cellScalarResults(scalarResultIndex));
|
||||||
|
size_t timeStepCount = rimCase->results(m_porosityModelEnum)->cellResults()->maxTimeStepCount();
|
||||||
|
scalarResultFrames->resize(timeStepCount);
|
||||||
|
|
||||||
m_currentScalarIndex = scalarResultIndex;
|
m_currentScalarIndex = scalarResultIndex;
|
||||||
m_currentPropertyName = propertyName;
|
m_currentPropertyName = propertyName;
|
||||||
}
|
}
|
||||||
@ -484,17 +487,6 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resize the result container to be able to receive timesteps at the specified timestep idices
|
|
||||||
|
|
||||||
std::vector<size_t>::iterator maxTimeStepIt = std::max_element(m_requestedTimesteps.begin(), m_requestedTimesteps.end());
|
|
||||||
CVF_ASSERT(maxTimeStepIt != m_requestedTimesteps.end());
|
|
||||||
|
|
||||||
size_t maxTimeStepIdx = (*maxTimeStepIt);
|
|
||||||
if (scalarResultFrames->size() <= maxTimeStepIdx)
|
|
||||||
{
|
|
||||||
scalarResultFrames->resize(maxTimeStepIdx+1);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_currentReservoir = rimCase;
|
m_currentReservoir = rimCase;
|
||||||
m_scalarResultsToAdd = scalarResultFrames;
|
m_scalarResultsToAdd = scalarResultFrames;
|
||||||
|
|
||||||
@ -778,6 +770,9 @@ public:
|
|||||||
if (scalarResultIndex != cvf::UNDEFINED_SIZE_T)
|
if (scalarResultIndex != cvf::UNDEFINED_SIZE_T)
|
||||||
{
|
{
|
||||||
scalarResultFrames = &(rimCase->results(m_porosityModelEnum)->cellResults()->cellScalarResults(scalarResultIndex));
|
scalarResultFrames = &(rimCase->results(m_porosityModelEnum)->cellResults()->cellScalarResults(scalarResultIndex));
|
||||||
|
size_t timeStepCount = rimCase->results(m_porosityModelEnum)->cellResults()->maxTimeStepCount();
|
||||||
|
scalarResultFrames->resize(timeStepCount);
|
||||||
|
|
||||||
m_currentScalarIndex = scalarResultIndex;
|
m_currentScalarIndex = scalarResultIndex;
|
||||||
m_currentPropertyName = propertyName;
|
m_currentPropertyName = propertyName;
|
||||||
}
|
}
|
||||||
@ -834,17 +829,6 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resize the result container to be able to receive time steps at the specified time step indices
|
|
||||||
|
|
||||||
std::vector<size_t>::iterator maxTimeStepIt = std::max_element(m_requestedTimesteps.begin(), m_requestedTimesteps.end());
|
|
||||||
CVF_ASSERT(maxTimeStepIt != m_requestedTimesteps.end());
|
|
||||||
|
|
||||||
size_t maxTimeStepIdx = (*maxTimeStepIt);
|
|
||||||
if (scalarResultFrames->size() <= maxTimeStepIdx)
|
|
||||||
{
|
|
||||||
scalarResultFrames->resize(maxTimeStepIdx+1);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_currentReservoir = rimCase;
|
m_currentReservoir = rimCase;
|
||||||
m_scalarResultsToAdd = scalarResultFrames;
|
m_scalarResultsToAdd = scalarResultFrames;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user