]> https://gitweb.dealii.org/ - dealii.git/commitdiff
New test 3894/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Wed, 1 Feb 2017 20:48:50 +0000 (21:48 +0100)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Wed, 1 Feb 2017 20:49:05 +0000 (21:49 +0100)
tests/lac/constraints_merge_12.cc [new file with mode: 0644]
tests/lac/constraints_merge_12.output [new file with mode: 0644]

diff --git a/tests/lac/constraints_merge_12.cc b/tests/lac/constraints_merge_12.cc
new file mode 100644 (file)
index 0000000..d64041b
--- /dev/null
@@ -0,0 +1,64 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2017 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+
+// Merge two ConstraintMatrix objects initialized with IndexSets where entries
+// have been added in a way that local_lines extends beyond the end of the
+// IndexSet
+
+#include "../tests.h"
+#include <deal.II/lac/constraint_matrix.h>
+#include <deal.II/base/logstream.h>
+
+#include <fstream>
+#include <iomanip>
+
+
+void merge_check ()
+{
+  deallog << "Checking ConstraintMatrix::merge with localized lines" << std::endl;
+
+  // set local lines to a very large range that surely triggers an error if
+  // the implementation is wrong
+  IndexSet local_lines (100000000);
+  local_lines.add_range (99999800, 100000000);
+  local_lines.compress();
+
+  // works correctly
+  ConstraintMatrix c1 (local_lines), c2 (local_lines);
+  for (types::global_dof_index i=99999800; i<local_lines.size(); ++i)
+    if (i%2 == 1)
+      c1.add_line(i);
+
+  c2.add_line(99999800);
+  c2.add_line(99999801);
+  c2.add_line(99999802);
+
+  // now merge the two and print the results
+  c2.merge (c1, ConstraintMatrix::right_object_wins);
+  c2.print(deallog.get_file_stream());
+
+  deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+  initlog();
+
+  merge_check ();
+}
diff --git a/tests/lac/constraints_merge_12.output b/tests/lac/constraints_merge_12.output
new file mode 100644 (file)
index 0000000..207f29b
--- /dev/null
@@ -0,0 +1,105 @@
+
+DEAL::Checking ConstraintMatrix::merge with localized lines
+    99999800 = 0
+    99999801 = 0
+    99999802 = 0
+    99999803 = 0
+    99999805 = 0
+    99999807 = 0
+    99999809 = 0
+    99999811 = 0
+    99999813 = 0
+    99999815 = 0
+    99999817 = 0
+    99999819 = 0
+    99999821 = 0
+    99999823 = 0
+    99999825 = 0
+    99999827 = 0
+    99999829 = 0
+    99999831 = 0
+    99999833 = 0
+    99999835 = 0
+    99999837 = 0
+    99999839 = 0
+    99999841 = 0
+    99999843 = 0
+    99999845 = 0
+    99999847 = 0
+    99999849 = 0
+    99999851 = 0
+    99999853 = 0
+    99999855 = 0
+    99999857 = 0
+    99999859 = 0
+    99999861 = 0
+    99999863 = 0
+    99999865 = 0
+    99999867 = 0
+    99999869 = 0
+    99999871 = 0
+    99999873 = 0
+    99999875 = 0
+    99999877 = 0
+    99999879 = 0
+    99999881 = 0
+    99999883 = 0
+    99999885 = 0
+    99999887 = 0
+    99999889 = 0
+    99999891 = 0
+    99999893 = 0
+    99999895 = 0
+    99999897 = 0
+    99999899 = 0
+    99999901 = 0
+    99999903 = 0
+    99999905 = 0
+    99999907 = 0
+    99999909 = 0
+    99999911 = 0
+    99999913 = 0
+    99999915 = 0
+    99999917 = 0
+    99999919 = 0
+    99999921 = 0
+    99999923 = 0
+    99999925 = 0
+    99999927 = 0
+    99999929 = 0
+    99999931 = 0
+    99999933 = 0
+    99999935 = 0
+    99999937 = 0
+    99999939 = 0
+    99999941 = 0
+    99999943 = 0
+    99999945 = 0
+    99999947 = 0
+    99999949 = 0
+    99999951 = 0
+    99999953 = 0
+    99999955 = 0
+    99999957 = 0
+    99999959 = 0
+    99999961 = 0
+    99999963 = 0
+    99999965 = 0
+    99999967 = 0
+    99999969 = 0
+    99999971 = 0
+    99999973 = 0
+    99999975 = 0
+    99999977 = 0
+    99999979 = 0
+    99999981 = 0
+    99999983 = 0
+    99999985 = 0
+    99999987 = 0
+    99999989 = 0
+    99999991 = 0
+    99999993 = 0
+    99999995 = 0
+    99999997 = 0
+    99999999 = 0
+DEAL::OK

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.