]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Split test into two that are a bit more atomic.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 19 Sep 2010 00:44:19 +0000 (00:44 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 19 Sep 2010 00:44:19 +0000 (00:44 +0000)
git-svn-id: https://svn.dealii.org/trunk@22042 0785d39b-7218-0410-832d-ea1e28bc413d

tests/deal.II/constraints.cc
tests/deal.II/constraints/cmp/generic
tests/deal.II/constraints_merge.cc [new file with mode: 0644]
tests/deal.II/constraints_merge/cmp/generic [new file with mode: 0644]

index 5190fb37a8fec0f6a6b55cd5f167914c2f827239..36cf4ae04b83b101339aa4301363e0b64f86376f 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2008 by the deal.II authors
+//    Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2008, 2010 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -12,7 +12,7 @@
 //----------------------------  constraints.cc  ---------------------------
 
 
-// create, merge, and print a bunch of ConstrainMatrices
+// create and print a bunch of ConstrainMatrices
 
 #include "../tests.h"
 #include <dofs/dof_handler.h>
@@ -241,55 +241,6 @@ void make_tria (Triangulation<3> &tria, int step)
 
 
 
-void merge_check ()
-{
-  deallog << "Checking ConstraintMatrix::merge" << std::endl;
-
-                                  // check twice, once with closed
-                                  // objects, once with open ones
-  for (unsigned int run=0; run<2; ++run)
-    {
-      deallog << "Checking with " << (run == 0 ? "open" : "closed")
-             << " objects" << std::endl;
-      
-                                      // check that the `merge' function
-                                      // works correctly
-      ConstraintMatrix c1, c2;
-
-                                      // enter simple line
-      c1.add_line (0);
-      c1.add_entry (0, 11, 1.);
-                                      // add more complex line
-      c1.add_line (1);
-      c1.add_entry (1, 3, 0.5);
-      c1.add_entry (1, 4, 0.5);
-  
-                                      // fill second constraints
-                                      // object with one trivial line
-                                      // and one which further
-                                      // constrains one of the
-                                      // entries in the first object
-      c2.add_line (10);
-      c2.add_entry (10, 11, 1.);
-      c2.add_line (3);
-      c2.add_entry (3, 12, 0.25);
-      c2.add_entry (3, 13, 0.75);
-
-                                      // in one of the two runs,
-                                      // close the objects
-      if (run == 1)
-       {
-         c1.close ();
-         c2.close ();
-       };
-
-                                      // now merge the two and print the
-                                      // results
-      c1.merge (c2);
-      c1.print (logfile);
-    };
-}
-
 
 int main ()
 {
@@ -338,7 +289,5 @@ int main ()
 
       delete fe;
     };
-
-  merge_check ();
 }
 
index 69e74eeda88abdc1d44017d370b0eeb160b49609..15b76a83934a668067c44792845d4f59613b7539 100644 (file)
@@ -6084,20 +6084,3 @@ DEAL::Element=1, Step=8
     273 43:  0.28
     273 45:  0.56
 DEAL::
-DEAL::Checking ConstraintMatrix::merge
-DEAL::Checking with open objects
-    0 11:  1.0
-    1 12:  0.12
-    1 13:  0.38
-    1 4:  0.50
-    10 11:  1.0
-    3 12:  0.25
-    3 13:  0.75
-DEAL::Checking with closed objects
-    0 11:  1.0
-    1 4:  0.50
-    1 12:  0.12
-    1 13:  0.38
-    3 12:  0.25
-    3 13:  0.75
-    10 11:  1.0
diff --git a/tests/deal.II/constraints_merge.cc b/tests/deal.II/constraints_merge.cc
new file mode 100644 (file)
index 0000000..864175b
--- /dev/null
@@ -0,0 +1,101 @@
+//----------------------------  constraints.cc  ---------------------------
+//    $Id$
+//    Version: $Name$ 
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2008, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//----------------------------  constraints.cc  ---------------------------
+
+
+// merge and print a bunch of ConstrainMatrices
+
+#include "../tests.h"
+#include <dofs/dof_handler.h>
+#include <grid/tria.h>
+#include <fe/mapping_q1.h>
+#include <fe/fe_q.h>
+#include <grid/tria_boundary.h>
+#include <grid/tria_iterator.h>
+#include <grid/tria_accessor.h>
+#include <lac/sparse_matrix.h>
+#include <base/parameter_handler.h>
+#include <dofs/dof_accessor.h>
+#include <lac/constraint_matrix.h>
+#include <dofs/dof_tools.h>
+#include <grid/grid_out.h>
+#include <base/logstream.h>
+
+#include <fstream>
+#include <cmath>
+#include <cstdlib>
+
+
+std::ofstream logfile("constraints_merge/output");
+
+
+void merge_check ()
+{
+  deallog << "Checking ConstraintMatrix::merge" << std::endl;
+
+                                  // check twice, once with closed
+                                  // objects, once with open ones
+  for (unsigned int run=0; run<2; ++run)
+    {
+      deallog << "Checking with " << (run == 0 ? "open" : "closed")
+             << " objects" << std::endl;
+      
+                                      // check that the `merge' function
+                                      // works correctly
+      ConstraintMatrix c1, c2;
+
+                                      // enter simple line
+      c1.add_line (0);
+      c1.add_entry (0, 11, 1.);
+                                      // add more complex line
+      c1.add_line (1);
+      c1.add_entry (1, 3, 0.5);
+      c1.add_entry (1, 4, 0.5);
+  
+                                      // fill second constraints
+                                      // object with one trivial line
+                                      // and one which further
+                                      // constrains one of the
+                                      // entries in the first object
+      c2.add_line (10);
+      c2.add_entry (10, 11, 1.);
+      c2.add_line (3);
+      c2.add_entry (3, 12, 0.25);
+      c2.add_entry (3, 13, 0.75);
+
+                                      // in one of the two runs,
+                                      // close the objects
+      if (run == 1)
+       {
+         c1.close ();
+         c2.close ();
+       };
+
+                                      // now merge the two and print the
+                                      // results
+      c1.merge (c2);
+      c1.print (logfile);
+    };
+}
+
+
+int main ()
+{
+  deallog << std::setprecision (2);
+  logfile << std::setprecision (2);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  merge_check ();
+}
+
diff --git a/tests/deal.II/constraints_merge/cmp/generic b/tests/deal.II/constraints_merge/cmp/generic
new file mode 100644 (file)
index 0000000..6b00e44
--- /dev/null
@@ -0,0 +1,18 @@
+
+DEAL::Checking ConstraintMatrix::merge
+DEAL::Checking with open objects
+    0 11:  1.0
+    1 12:  0.12
+    1 13:  0.38
+    1 4:  0.50
+    10 11:  1.0
+    3 12:  0.25
+    3 13:  0.75
+DEAL::Checking with closed objects
+    0 11:  1.0
+    1 4:  0.50
+    1 12:  0.12
+    1 13:  0.38
+    3 12:  0.25
+    3 13:  0.75
+    10 11:  1.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.