From c61ca0d0a7d0fda872dbcd20b9792a985397f53b Mon Sep 17 00:00:00 2001 From: Uwe Date: Mon, 1 Aug 2022 04:33:06 +0200 Subject: [PATCH] [FEM] Elmer: fixes for the point filter - use correct names and support all possible outputs --- src/Mod/Fem/Gui/TaskPostBoxes.cpp | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/Mod/Fem/Gui/TaskPostBoxes.cpp b/src/Mod/Fem/Gui/TaskPostBoxes.cpp index 4e333f5e76..43ca69157a 100644 --- a/src/Mod/Fem/Gui/TaskPostBoxes.cpp +++ b/src/Mod/Fem/Gui/TaskPostBoxes.cpp @@ -1101,25 +1101,30 @@ void TaskPostDataAtPoint::on_Field_activated(int i) { static_cast(getObject())->FieldName.setValue(FieldName); // 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. - + + // CCX names if ( (FieldName == "von Mises Stress") || (FieldName == "Tresca Stress") - || (FieldName == "Major Principal Stress") || (FieldName == "Intermediate Principal Stress") - || (FieldName == "Minor Principal Stress") + || (FieldName == "Major Principal Stress") || (FieldName == "Minor Principal Stress") + || (FieldName == "Intermediate 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.find("tresca Eigen", 0) == 0) || (FieldName.find("vonmises Eigen", 0) == 0) - || (FieldName.find("stress_", 0) == 0) - || (FieldName.find("principal stress Eigen", 0) == 0) ) { + || (FieldName == "Stress yz component") || (FieldName == "Stress zz component") ) { static_cast(getObject())->Unit.setValue("Pa"); } + // The elmer names are different. If there are EigenModes, the names are unique for + // every mode. Therefore we only check for the beginning of the name. + else if ( (FieldName.find("tresca", 0) == 0) || (FieldName.find("vonmises", 0) == 0) + || (FieldName.find("stress_", 0) == 0) || (FieldName.find("principal stress", 0) == 0) ) { + static_cast(getObject())->Unit.setValue("Pa"); + } else if ( (FieldName == "Displacement") || (FieldName == "Displacement Magnitude") - || (FieldName.find("displacement Eigen", 0) == 0) ) { + || (FieldName.find("displacement", 0) == 0) // Elmer name + ) { static_cast(getObject())->Unit.setValue("m"); } - else if (FieldName == "Temperature") { + else if (FieldName == "Temperature" + || (FieldName.find("temperature", 0) == 0) // Elmer name + ) { static_cast(getObject())->Unit.setValue("K"); } else if (FieldName == "electric field") {