From beabc77de78ab04c7fe46bbdc71aace0c20418c1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20Wichrowski?= Date: Thu, 1 May 2025 19:46:59 +0200 Subject: [PATCH] improve the output --- tests/numerics/tensor_product_creator_02.cc | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/tests/numerics/tensor_product_creator_02.cc b/tests/numerics/tensor_product_creator_02.cc index a19a6ef9f8..c8c8232091 100644 --- a/tests/numerics/tensor_product_creator_02.cc +++ b/tests/numerics/tensor_product_creator_02.cc @@ -28,15 +28,18 @@ test(const unsigned int fe_degree) FE_Q<1>(fe_degree), 1.); - for (unsigned int row = 0; row < ghost_penalty_1d.n_rows(); ++row) - { - for (unsigned int col = 0; col < ghost_penalty_1d.n_cols(); ++col) - deallog << std::setw(10) << std::fixed << std::setprecision(4) - << ghost_penalty_1d(row, col) << " "; - - deallog << std::endl; - } - deallog << std::endl; + std::stringstream sstring; + + sstring << "Ghost penalty matrix for FE_Q<1>(" << fe_degree << "):\n"; + ghost_penalty_1d.print_formatted(sstring, 4, true, 10, "0."); + + deallog << sstring.str() << std::endl; + + // Check that the matrix is symmetric + for (unsigned int i = 0; i < ghost_penalty_1d.m(); ++i) + for (unsigned int j = 0; j < ghost_penalty_1d.n(); ++j) + AssertThrow(ghost_penalty_1d(i, j) == ghost_penalty_1d(j, i), + ExcMessage("Matrix is not symmetric")); } -- 2.39.5