From 8e9654f3472731e2944bfb9de0e9f70ef81a3d3d Mon Sep 17 00:00:00 2001 From: Yimin Jin Date: Sat, 20 Jan 2024 17:16:08 +0800 Subject: [PATCH] change the test output --- tests/dofs/dof_accessor_04.cc | 42 +++++++++++++------------------ tests/dofs/dof_accessor_04.output | 21 +++++++++++++++- 2 files changed, 37 insertions(+), 26 deletions(-) diff --git a/tests/dofs/dof_accessor_04.cc b/tests/dofs/dof_accessor_04.cc index f4b205aa0e..69b1075e29 100644 --- a/tests/dofs/dof_accessor_04.cc +++ b/tests/dofs/dof_accessor_04.cc @@ -13,8 +13,11 @@ // // --------------------------------------------------------------------- -// Test DoFCellAccessor::distribute_local_to_global( -// local_matrix, local_vector, global_matrix, global_vector) + +// Test DoFCellAccessor::distribute_local_to_global(local_matrix, +// local_vector, +// global_matrix, +// global_vector) #include #include @@ -73,29 +76,18 @@ main() global_matrix, global_vector); - // check if each entry of the local matrix/vector has - // found its position in the global matrix/vector - bool passed = true; - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) - { - if (global_vector(i) != local_vector(i)) - passed = false; - - for (unsigned int j = 0; j < fe.dofs_per_cell; ++j) - if (global_matrix(i, j) != local_matrix(i, j)) - { - passed = false; - break; - } - - if (passed == false) - break; - } - - if (passed) - deallog << "PASSED" << std::endl; - else - deallog << "NOT PASSED" << std::endl; + // output the local matrix and the local vector + deallog << "local matrix:" << std::endl; + local_matrix.print_formatted(deallog.get_file_stream(), 0, false, 3); + deallog << "local vector:" << std::endl; + local_vector.print(deallog.get_file_stream(), 0, false, 3); + deallog << std::endl; + + // output the global matrix and the global vector + deallog << "global matrix:" << std::endl; + global_matrix.print_formatted(deallog.get_file_stream(), 0, false, 3); + deallog << "global vector:" << std::endl; + global_vector.print(deallog.get_file_stream(), 0, false, 3); return 0; } diff --git a/tests/dofs/dof_accessor_04.output b/tests/dofs/dof_accessor_04.output index 126825131c..b5f6883cf9 100644 --- a/tests/dofs/dof_accessor_04.output +++ b/tests/dofs/dof_accessor_04.output @@ -1,2 +1,21 @@ -DEAL::PASSED +DEAL::local matrix: +1. 2. 3. 4. +5. 6. 7. 8. +9. 10. 11. 12. +13. 14. 15. 16. +DEAL::local vector: +1. 2. 3. 4. +DEAL:: +DEAL::global matrix: +1. 2. 3. 4. +5. 6. 7. 8. 0. 0. +9. 10. 11. 12. 0. 0. +13. 14. 15. 16. 0. 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. 0. 0. + 0. 0. 0. 0. +DEAL::global vector: +1. 2. 3. 4. 0. 0. 0. 0. 0. -- 2.39.5