From 18db97c39bd5f655859f3f8950794eb6bf96bd78 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Mon, 28 Aug 2023 15:41:38 +0200 Subject: [PATCH] Remove unnecessary code in a test --- tests/matrix_free/get_functions_common.h | 49 +++++------------------- 1 file changed, 10 insertions(+), 39 deletions(-) diff --git a/tests/matrix_free/get_functions_common.h b/tests/matrix_free/get_functions_common.h index 93df2b917b..e018de5954 100644 --- a/tests/matrix_free/get_functions_common.h +++ b/tests/matrix_free/get_functions_common.h @@ -161,45 +161,16 @@ public: Vector dst_dummy; data.cell_loop(&MatrixFreeTest::operator(), this, dst_dummy, src); - // for doubles, use a stricter condition than - // for floats for the relative error size - if (std::is_same_v == true) - { - deallog << "Error function values: " << errors[0] / total[0] - << std::endl; - deallog << "Error function gradients: " << errors[1] / total[1] - << std::endl; - - // need to set quite a loose tolerance because - // FEValues approximates Hessians with finite - // differences, which are not so - // accurate. moreover, Hessians are quite - // large since we chose random numbers. for - // some elements, it might also be zero - // (linear elements on quadrilaterals), so - // need to check for division by 0, too. - const double output2 = total[2] == 0 ? 0. : errors[2] / total[2]; - deallog << "Error function Laplacians: " << output2 << std::endl; - const double output3 = total[3] == 0 ? 0. : errors[3] / total[3]; - deallog << "Error function diagonal of Hessian: " << output3 - << std::endl; - const double output4 = total[4] == 0 ? 0. : errors[4] / total[4]; - deallog << "Error function Hessians: " << output4 << std::endl; - } - else if (std::is_same_v == true) - { - deallog << "Error function values: " << errors[0] / total[0] - << std::endl; - deallog << "Error function gradients: " << errors[1] / total[1] - << std::endl; - const double output2 = total[2] == 0 ? 0. : errors[2] / total[2]; - deallog << "Error function Laplacians: " << output2 << std::endl; - const double output3 = total[3] == 0 ? 0. : errors[3] / total[3]; - deallog << "Error function diagonal of Hessian: " << output3 - << std::endl; - const double output4 = total[4] == 0 ? 0. : errors[4] / total[4]; - deallog << "Error function Hessians: " << output4 << std::endl; - } + deallog << "Error function values: " << errors[0] / total[0] << std::endl; + deallog << "Error function gradients: " << errors[1] / total[1] + << std::endl; + + const double output2 = total[2] == 0 ? 0. : errors[2] / total[2]; + deallog << "Error function Laplacians: " << output2 << std::endl; + const double output3 = total[3] == 0 ? 0. : errors[3] / total[3]; + deallog << "Error function diagonal of Hessian: " << output3 << std::endl; + const double output4 = total[4] == 0 ? 0. : errors[4] / total[4]; + deallog << "Error function Hessians: " << output4 << std::endl; deallog << std::endl; }; -- 2.39.5