From 7c382f7c09cf8fe84bccc88acceb8381721c783c Mon Sep 17 00:00:00 2001 From: Uwe Date: Sun, 31 Jul 2022 04:30:31 +0200 Subject: [PATCH] [FEM] Elmer: fix eigenmode results for point filter Elmers' eigenmode results have a different result name --- src/Mod/Fem/Gui/TaskPostBoxes.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Mod/Fem/Gui/TaskPostBoxes.cpp b/src/Mod/Fem/Gui/TaskPostBoxes.cpp index 62dcf2af2c..4e333f5e76 100644 --- a/src/Mod/Fem/Gui/TaskPostBoxes.cpp +++ b/src/Mod/Fem/Gui/TaskPostBoxes.cpp @@ -1099,15 +1099,24 @@ void TaskPostDataAtPoint::on_Field_activated(int i) { return; } static_cast(getObject())->FieldName.setValue(FieldName); - if ((FieldName == "von Mises Stress") || (FieldName == "Tresca Stress") + + // Set the unit for the different known result types. + // For the Elmer EigenModes, the names are different and unique. For them we only check + // the beginning of the name. + + if ( (FieldName == "von Mises Stress") || (FieldName == "Tresca Stress") || (FieldName == "Major Principal Stress") || (FieldName == "Intermediate Principal Stress") || (FieldName == "Minor Principal Stress") || (FieldName == "Stress xx component") || (FieldName == "Stress xy component") || (FieldName == "Stress xz component") || (FieldName == "Stress yy component") - || (FieldName == "Stress yz component") || (FieldName == "Stress zz component")) { + || (FieldName == "Stress yz component") || (FieldName == "Stress zz component") + || (FieldName.find("tresca Eigen", 0) == 0) || (FieldName.find("vonmises Eigen", 0) == 0) + || (FieldName.find("stress_", 0) == 0) + || (FieldName.find("principal stress Eigen", 0) == 0) ) { static_cast(getObject())->Unit.setValue("Pa"); } - else if ((FieldName == "Displacement") || (FieldName == "Displacement Magnitude")) { + else if ( (FieldName == "Displacement") || (FieldName == "Displacement Magnitude") + || (FieldName.find("displacement Eigen", 0) == 0) ) { static_cast(getObject())->Unit.setValue("m"); } else if (FieldName == "Temperature") {