]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Test that norms on tensors of VectorizedArray work
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Sun, 12 Mar 2017 18:59:38 +0000 (19:59 +0100)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Sun, 12 Mar 2017 20:00:55 +0000 (21:00 +0100)
tests/base/vectorization_08.cc [new file with mode: 0644]
tests/base/vectorization_08.output [new file with mode: 0644]

diff --git a/tests/base/vectorization_08.cc b/tests/base/vectorization_08.cc
new file mode 100644 (file)
index 0000000..71d5099
--- /dev/null
@@ -0,0 +1,38 @@
+// ---------------------------------------------------------------------
+//
+// 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.
+//
+// ---------------------------------------------------------------------
+
+// check that operations on tensors of vectorized arrays are properly
+// supported
+
+#include "../tests.h"
+
+#include <deal.II/base/point.h>
+#include <deal.II/base/symmetric_tensor.h>
+#include <deal.II/base/tensor.h>
+#include <deal.II/base/vectorization.h>
+
+int main()
+{
+  initlog();
+
+  Tensor<1,2,VectorizedArray<double> > t;
+  deallog << "Tensor norm: " << t.norm()[0] << std::endl;
+  Point<3,VectorizedArray<float> > p;
+  deallog << "Point norm: " << p.norm()[0] << std::endl;
+  SymmetricTensor<2,3,VectorizedArray<double> > st2;
+  SymmetricTensor<4,2,VectorizedArray<double> > st4;
+  deallog << "Symmetric tensor norm: " << st2.norm()[0]
+          << " " << st4.norm()[0] << std::endl;
+}
diff --git a/tests/base/vectorization_08.output b/tests/base/vectorization_08.output
new file mode 100644 (file)
index 0000000..f85ab0c
--- /dev/null
@@ -0,0 +1,4 @@
+
+DEAL::Tensor norm: 0.00000
+DEAL::Point norm: 0
+DEAL::Symmetric tensor norm: 0.00000 0.00000

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.