From 5f49b1e3fa19a33eeac1b47950b8a3bb69a5f28c Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <github@naumov.de>
Date: Sun, 14 Jan 2018 21:42:16 +0100
Subject: [PATCH] [MeL] Fix getOrCreateMeshProperty for IP data.

For an existing, non-empty mesh property on integration
points the check fails and it is not possible to know
what the size of this data should be.
Omitting the assertion for this case.
---
 MeshLib/Mesh.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/MeshLib/Mesh.h b/MeshLib/Mesh.h
index 32282a5e74c..91f246ab6f9 100644
--- a/MeshLib/Mesh.h
+++ b/MeshLib/Mesh.h
@@ -268,7 +268,13 @@ PropertyVector<T>* getOrCreateMeshProperty(Mesh& mesh,
         auto result =
             mesh.getProperties().template getPropertyVector<T>(property_name);
         assert(result);
-        assert(result->size() == numberOfMeshItems() * number_of_components);
+        if (item_type != MeshItemType::IntegrationPoint)
+        {
+            // Test the size if number of mesh items is known, which is not the
+            // case for the integration point data.
+            assert(result->size() ==
+                   numberOfMeshItems() * number_of_components);
+        }
         return result;
     }
 
-- 
GitLab