fix writing abaqus file

See https://github.com/NGSolve/netgen/issues/212
This commit is contained in:
Christopher Lackner 2025-05-13 11:30:39 +02:00
parent 421c10b1af
commit 89fde04694

View File

@ -7545,9 +7545,9 @@ namespace netgen
} }
string Mesh :: cd3_default_name = "default"; string Mesh :: cd3_default_name = "default";
static string defaultstring = "default";
const string & Mesh :: GetCD3Name (int cd3nr) const const string & Mesh :: GetCD3Name (int cd3nr) const
{ {
static string defaultstring = "default";
if (!cd3names.Size()) if (!cd3names.Size())
return defaultstring; return defaultstring;
@ -7586,6 +7586,9 @@ namespace netgen
std::string_view Mesh :: GetRegionName (const Element & el) const std::string_view Mesh :: GetRegionName (const Element & el) const
{ {
const auto& names = const_cast<Mesh&>(*this).GetRegionNamesCD(GetDimension()-3);
if(names.Size() <= el.GetIndex())
return defaultstring;
return *const_cast<Mesh&>(*this).GetRegionNamesCD(GetDimension()-3)[el.GetIndex()-1]; return *const_cast<Mesh&>(*this).GetRegionNamesCD(GetDimension()-3)[el.GetIndex()-1];
} }