From 6e6c23b05eaf8b62b8fb52f2012a686627924f2f Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Tue, 24 Oct 2023 15:03:54 +0200 Subject: [PATCH] Fix printed face name on double click for 2d meshes --- libsrc/visualization/vsmesh.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libsrc/visualization/vsmesh.cpp b/libsrc/visualization/vsmesh.cpp index d6c775d8..d4bf2dfe 100644 --- a/libsrc/visualization/vsmesh.cpp +++ b/libsrc/visualization/vsmesh.cpp @@ -3448,7 +3448,13 @@ namespace netgen cout << endl << "select element " << selelement << " on face " << sel.GetIndex(); // output face name - auto name = GetMesh()->GetFaceDescriptor(sel.GetIndex()).GetBCName(); + auto mesh = GetMesh(); + string name; + if(mesh->GetDimension() == 3) + name = mesh->GetFaceDescriptor(sel.GetIndex()).GetBCName(); + else + name = mesh->GetMaterial(sel.GetIndex()); + if(name != "") cout << " with name " << name; cout << endl;