From c61af10605dcdc466cff14d3f7a85e330e73b06f Mon Sep 17 00:00:00 2001 From: Christian Glusa Date: Wed, 23 Jun 2021 09:06:04 -0600 Subject: [PATCH 1/3] MueLu ML2MueLuParameterTranslator: Recognize MLS --- .../Interface/MueLu_ML2MueLuParameterTranslator.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/muelu/src/Interface/MueLu_ML2MueLuParameterTranslator.cpp b/packages/muelu/src/Interface/MueLu_ML2MueLuParameterTranslator.cpp index 3ca4d06f5c94..d047a61cafbb 100644 --- a/packages/muelu/src/Interface/MueLu_ML2MueLuParameterTranslator.cpp +++ b/packages/muelu/src/Interface/MueLu_ML2MueLuParameterTranslator.cpp @@ -103,7 +103,7 @@ namespace MueLu { } } - } else if ( valuestr == "chebyshev" ) { + } else if (( valuestr == "chebyshev" ) || ( valuestr == "mls" )) { std::string my_name = "\"" + pname + "\""; mueluss << "" << std::endl; @@ -163,6 +163,16 @@ namespace MueLu { else { mueluss << "" << std::endl; adaptingParamList.remove("smoother: Chebyshev alpha",false); } } + // MLS + if ( valuestr == "mls") { + if ( paramList.isParameter("smoother: MLS polynomial order") ) { mueluss << "("smoother: MLS polynomial order") << "\"/>" << std::endl; adaptingParamList.remove("smoother: MLS polynomial order",false); } + else if ( paramList.isParameter("smoother: polynomial order") ) { mueluss << "("smoother: polynomial order") << "\"/>" << std::endl; adaptingParamList.remove("smoother: polynomial order",false); } + else { mueluss << "" << std::endl; } + if ( paramList.isParameter("smoother: MLS alpha") ) { mueluss << "("smoother: MLS alpha") << "\"/>" << std::endl; adaptingParamList.remove("smoother: MLS alpha",false); } + else if ( paramList.isParameter("smoother: Chebyshev alpha") ) { mueluss << "("smoother: Chebyshev alpha") << "\"/>" << std::endl; adaptingParamList.remove("smoother: Chebyshev alpha",false); } + else { mueluss << "" << std::endl; } + } + // parameters for ILU based preconditioners if ( valuestr == "ifpack") { From 39b9929b50ec4e809522c4def9783f07bb9606ab Mon Sep 17 00:00:00 2001 From: Christian Glusa Date: Wed, 23 Jun 2021 09:06:30 -0600 Subject: [PATCH 2/3] MueLu: Test fixes for float --- packages/muelu/test/unit_tests/RAPShiftFactory.cpp | 4 ++-- packages/muelu/test/unit_tests/Smoothers/BelosSmoother.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/muelu/test/unit_tests/RAPShiftFactory.cpp b/packages/muelu/test/unit_tests/RAPShiftFactory.cpp index dcaa3463f779..05e8e56e29d4 100644 --- a/packages/muelu/test/unit_tests/RAPShiftFactory.cpp +++ b/packages/muelu/test/unit_tests/RAPShiftFactory.cpp @@ -381,7 +381,7 @@ namespace MueLuTests { out << "||X||_2 = " << normX << std::endl; result1->norm2(normResult1); result2->norm2(normResult2); - TEST_FLOATING_EQUALITY(normResult1[0], normResult2[0], 1e-12); + TEST_FLOATING_EQUALITY(normResult1[0], normResult2[0], 1e4*Teuchos::ScalarTraits::magnitudeType>::eps()); } @@ -459,7 +459,7 @@ namespace MueLuTests { out << "||X||_2 = " << normX << std::endl; result1->norm2(normResult1); result2->norm2(normResult2); - TEST_FLOATING_EQUALITY(normResult1[0], normResult2[0], 1e-12); + TEST_FLOATING_EQUALITY(normResult1[0], normResult2[0], 1e4*Teuchos::ScalarTraits::magnitudeType>::eps()); } diff --git a/packages/muelu/test/unit_tests/Smoothers/BelosSmoother.cpp b/packages/muelu/test/unit_tests/Smoothers/BelosSmoother.cpp index a492b7547e73..0a1ea42cfeec 100644 --- a/packages/muelu/test/unit_tests/Smoothers/BelosSmoother.cpp +++ b/packages/muelu/test/unit_tests/Smoothers/BelosSmoother.cpp @@ -87,7 +87,7 @@ namespace MueLuTests { RCP > comm = TestHelpers::Parameters::getDefaultComm(); const typename Teuchos::ScalarTraits::magnitudeType expectedNorm = 1.2856486930664495771e-01; - TEST_FLOATING_EQUALITY(residualNorms,expectedNorm,1e-12); + TEST_FLOATING_EQUALITY(residualNorms,expectedNorm,1e4*Teuchos::ScalarTraits::magnitudeType>::eps()); } } // Block CG From ce906f46a9edb7dc5cfb61305532a945fa53df59 Mon Sep 17 00:00:00 2001 From: Christian Glusa Date: Wed, 23 Jun 2021 09:09:13 -0600 Subject: [PATCH 3/3] MueLu: Disable StratimikosSmoother test in no-Tpetra builds --- packages/muelu/test/unit_tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/muelu/test/unit_tests/CMakeLists.txt b/packages/muelu/test/unit_tests/CMakeLists.txt index ecd053ff220e..ef8032f7aca6 100644 --- a/packages/muelu/test/unit_tests/CMakeLists.txt +++ b/packages/muelu/test/unit_tests/CMakeLists.txt @@ -150,7 +150,7 @@ IF (${PACKAGE_NAME}_ENABLE_Belos) APPEND_SET(SOURCES Smoothers/BelosSmoother.cpp) ENDIF() -IF (${PACKAGE_NAME}_ENABLE_Stratimikos AND ${PACKAGE_NAME}_ENABLE_Thyra) +IF (${PACKAGE_NAME}_ENABLE_Stratimikos AND ${PACKAGE_NAME}_ENABLE_Tpetra AND ${PACKAGE_NAME}_ENABLE_Thyra) APPEND_SET(SOURCES Smoothers/StratimikosSmoother.cpp) ENDIF()