#3061 Implement Memory Cleanup for eclipse data.

This commit is contained in:
Gaute Lindkvist
2018-06-19 15:28:35 +02:00
parent e3e4e79340
commit 5fc795a24a
6 changed files with 133 additions and 9 deletions

View File

@@ -632,11 +632,13 @@ void RigCaseCellResultsData::clearScalarResult(RiaDefines::ResultCatType type, c
size_t scalarResultIndex = this->findScalarResultIndex(type, resultName);
if (scalarResultIndex == cvf::UNDEFINED_SIZE_T) return;
std::vector<std::vector<double>> empty;
m_cellScalarResults[scalarResultIndex].swap(empty);
for (size_t tsIdx = 0; tsIdx < m_cellScalarResults[scalarResultIndex].size(); ++tsIdx)
{
std::vector<double> empty;
m_cellScalarResults[scalarResultIndex][tsIdx].swap(empty);
}
recalculateStatistics(scalarResultIndex);
//m_resultInfos[scalarResultIndex].type() = RiaDefines::REMOVED;
}
//--------------------------------------------------------------------------------------------------
@@ -674,6 +676,20 @@ void RigCaseCellResultsData::freeAllocatedResultsData()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RigCaseCellResultsData::isResultLoaded(const RigEclipseResultInfo& resultInfo) const
{
size_t scalarResultIndex = this->findScalarResultIndex(resultInfo.resultType(), resultInfo.resultName());
CVF_TIGHT_ASSERT(scalarResultIndex != cvf::UNDEFINED_SIZE_T);
if (scalarResultIndex != cvf::UNDEFINED_SIZE_T)
{
return isDataPresent(scalarResultIndex);
}
return false;
}
//--------------------------------------------------------------------------------------------------
/// Make sure we have a result with given type and name, and make sure one "timestep" result vector
// for the static result values are allocated