]> https://gitweb.dealii.org/ - dealii.git/commitdiff
change the test output 16489/head
authorYimin Jin <jinym@cea-igp.ac.cn>
Sat, 20 Jan 2024 09:16:08 +0000 (17:16 +0800)
committerYimin Jin <jinym@cea-igp.ac.cn>
Sat, 20 Jan 2024 09:16:08 +0000 (17:16 +0800)
tests/dofs/dof_accessor_04.cc
tests/dofs/dof_accessor_04.output

index f4b205aa0e41f52f203fa2c5e8fbe79b478e2e7b..69b1075e2953724dd45656ee1007605cc5850062 100644 (file)
 //
 // ---------------------------------------------------------------------
 
-// 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 <deal.II/dofs/dof_handler.h>
 #include <deal.II/dofs/dof_tools.h>
@@ -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;
 }
index 126825131cf3f311131e269d9a651f8408b02a5b..b5f6883cf9fd7337a5bdbc148bd5111c37e66f59 100644 (file)
@@ -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. 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.