From c22119e6a373d566fc1f49b4d5338553dbb7ae8d Mon Sep 17 00:00:00 2001 From: Stein Dale Date: Fri, 12 Jun 2015 20:02:35 +0200 Subject: [PATCH] Now allocating the correct amount of memory for results data The data size was multiplied by the number of components, which is wrong for the current interface. --- ApplicationCode/GeoMech/OdbReader/RifOdbReader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ApplicationCode/GeoMech/OdbReader/RifOdbReader.cpp b/ApplicationCode/GeoMech/OdbReader/RifOdbReader.cpp index 941b8b7d21..10fedeead2 100644 --- a/ApplicationCode/GeoMech/OdbReader/RifOdbReader.cpp +++ b/ApplicationCode/GeoMech/OdbReader/RifOdbReader.cpp @@ -967,7 +967,7 @@ void RifOdbReader::readNodeField(const std::string& fieldName, int partIndex, in std::map& nodeIdToIdxMap = m_nodeIdToIdxMaps[partIndex]; - size_t dataSize = nodeIdToIdxMap.size()*compCount; + size_t dataSize = nodeIdToIdxMap.size(); if (dataSize > 0) { for (int comp = 0; comp < compCount; comp++) @@ -1018,7 +1018,7 @@ void RifOdbReader::readElementNodeField(const std::string& fieldName, int partIn size_t compCount = componentsCount(fieldName, ELEMENT_NODAL); CVF_ASSERT(compCount == resultValues->size()); - size_t dataSize = resultItemCount(fieldName, partIndex, stepIndex, frameIndex)*compCount; + size_t dataSize = resultItemCount(fieldName, partIndex, stepIndex, frameIndex); if (dataSize > 0) { for (int comp = 0; comp < compCount; comp++) @@ -1089,7 +1089,7 @@ void RifOdbReader::readIntegrationPointField(const std::string& fieldName, int p size_t compCount = componentsCount(fieldName, INTEGRATION_POINT); CVF_ASSERT(compCount == resultValues->size()); - size_t dataSize = resultItemCount(fieldName, partIndex, stepIndex, frameIndex)*compCount; + size_t dataSize = resultItemCount(fieldName, partIndex, stepIndex, frameIndex); if (dataSize > 0) { for (int comp = 0; comp < compCount; comp++)