From 89fde0469421fd5965ecd92f1feebcadedb8da91 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Tue, 13 May 2025 11:30:39 +0200 Subject: [PATCH] fix writing abaqus file See https://github.com/NGSolve/netgen/issues/212 --- libsrc/meshing/meshclass.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index 031cd766..64ba6f47 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -7545,9 +7545,9 @@ namespace netgen } string Mesh :: cd3_default_name = "default"; + static string defaultstring = "default"; const string & Mesh :: GetCD3Name (int cd3nr) const { - static string defaultstring = "default"; if (!cd3names.Size()) return defaultstring; @@ -7586,6 +7586,9 @@ namespace netgen std::string_view Mesh :: GetRegionName (const Element & el) const { + const auto& names = const_cast(*this).GetRegionNamesCD(GetDimension()-3); + if(names.Size() <= el.GetIndex()) + return defaultstring; return *const_cast(*this).GetRegionNamesCD(GetDimension()-3)[el.GetIndex()-1]; }