]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add a test
authorMatthias Maier <tamiko@43-1.org>
Mon, 15 Apr 2019 16:30:30 +0000 (11:30 -0500)
committerMatthias Maier <tamiko@43-1.org>
Tue, 23 Apr 2019 01:34:42 +0000 (20:34 -0500)
tests/sparsity/dynamic_sparsity_pattern_21.cc [new file with mode: 0644]
tests/sparsity/dynamic_sparsity_pattern_21.output [new file with mode: 0644]

diff --git a/tests/sparsity/dynamic_sparsity_pattern_21.cc b/tests/sparsity/dynamic_sparsity_pattern_21.cc
new file mode 100644 (file)
index 0000000..cd217ae
--- /dev/null
@@ -0,0 +1,40 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2004 - 2019 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.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+// Check DynamicSparsityPattern::exists() with supplied rowindex by copying
+// to a static SparsityPattern.
+
+#include <deal.II/lac/dynamic_sparsity_pattern.h>
+#include <deal.II/lac/sparsity_pattern.h>
+
+#include "../tests.h"
+
+int
+main()
+{
+  initlog();
+
+  const unsigned int n_dofs = 2;
+  IndexSet           index_set(n_dofs);
+  index_set.add_index(1);
+
+  DynamicSparsityPattern dsp(n_dofs, n_dofs, index_set);
+  SparsityPattern        sp;
+  sp.copy_from(dsp);
+
+  deallog << "OK" << std::endl;
+
+  return 0;
+}
diff --git a/tests/sparsity/dynamic_sparsity_pattern_21.output b/tests/sparsity/dynamic_sparsity_pattern_21.output
new file mode 100644 (file)
index 0000000..0fd8fc1
--- /dev/null
@@ -0,0 +1,2 @@
+
+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.