]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add a test
authorMatthias Maier <tamiko@43-1.org>
Thu, 3 May 2018 02:48:47 +0000 (21:48 -0500)
committerMatthias Maier <tamiko@43-1.org>
Thu, 3 May 2018 18:57:36 +0000 (13:57 -0500)
tests/lac/linear_operator_17.cc [new file with mode: 0644]
tests/lac/linear_operator_17.output [new file with mode: 0644]

diff --git a/tests/lac/linear_operator_17.cc b/tests/lac/linear_operator_17.cc
new file mode 100644 (file)
index 0000000..6c2ad66
--- /dev/null
@@ -0,0 +1,51 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2015 - 2018 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.
+//
+// ---------------------------------------------------------------------
+
+// Test the LinearOperator template on a trivial vector implementation
+// :: RightVector -> LeftVector
+
+#include "../tests.h"
+
+#include <deal.II/lac/linear_operator.h>
+#include <deal.II/lac/vector.h>
+
+
+using namespace dealii;
+
+
+int main()
+{
+  initlog();
+
+  const std::function<void(Vector<double> &, bool)> reinit_vector =
+    [](Vector<double> &v, bool omit_zeroing_entries) {
+      v.reinit(3, omit_zeroing_entries);
+    };
+
+  const auto filter = mean_value_filter(reinit_vector);
+
+  Vector<double> vec (3);
+  vec[0] = 1.;
+  vec[1] = 2.;
+  vec[2] = 3.;
+
+  deallog << vec << std::endl;
+
+  filter.vmult_add(vec, vec);
+  deallog << vec << std::endl;
+
+  filter.vmult(vec, vec);
+  deallog << vec << std::endl;
+}
diff --git a/tests/lac/linear_operator_17.output b/tests/lac/linear_operator_17.output
new file mode 100644 (file)
index 0000000..16f0800
--- /dev/null
@@ -0,0 +1,7 @@
+
+DEAL::1.00000 2.00000 3.00000 
+DEAL::
+DEAL::0.00000 2.00000 4.00000 
+DEAL::
+DEAL::-2.00000 0.00000 2.00000 
+DEAL::

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.