From 54ee68d847353c72e9f5bba3d27e814a9d8980fe Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Mon, 22 Aug 2022 17:49:12 +0200 Subject: [PATCH] fix optimizing mesh without geometry --- libsrc/meshing/basegeom.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libsrc/meshing/basegeom.cpp b/libsrc/meshing/basegeom.cpp index cb5b8407..2e67d81e 100644 --- a/libsrc/meshing/basegeom.cpp +++ b/libsrc/meshing/basegeom.cpp @@ -1058,9 +1058,10 @@ namespace netgen void NetgenGeometry :: FinalizeMesh(Mesh& mesh) const { - for (int i = 0; i < mesh.GetNDomains(); i++) - if (auto name = solids[i]->properties.name) - mesh.SetMaterial (i+1, *name); + if(solids.Size()) + for (int i = 0; i < mesh.GetNDomains(); i++) + if (auto name = solids[i]->properties.name) + mesh.SetMaterial (i+1, *name); } shared_ptr GeometryRegisterArray :: LoadFromMeshFile (istream & ist) const