]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
New tests.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 9 Feb 2012 08:36:56 +0000 (08:36 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 9 Feb 2012 08:36:56 +0000 (08:36 +0000)
git-svn-id: https://svn.dealii.org/trunk@25019 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/tensor_04.cc [new file with mode: 0644]
tests/base/tensor_04/cmp/generic [new file with mode: 0644]
tests/base/tensor_05.cc [new file with mode: 0644]
tests/base/tensor_05/cmp/generic [new file with mode: 0644]

diff --git a/tests/base/tensor_04.cc b/tests/base/tensor_04.cc
new file mode 100644 (file)
index 0000000..3b028f7
--- /dev/null
@@ -0,0 +1,43 @@
+//----------------------------  tensor_04.cc  ---------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2006, 2012 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.
+//
+//----------------------------  tensor_04.cc  ---------------------------
+
+// check l1_norm(Tensor<2,dim>)
+
+#include "../tests.h"
+#include <deal.II/base/tensor.h>
+#include <deal.II/base/logstream.h>
+#include <deal.II/lac/vector.h>
+#include <fstream>
+#include <iomanip>
+
+int main ()
+{
+  std::ofstream logfile("tensor_04/output");
+  deallog << std::setprecision(3);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  double a[3][3] = {{1, 2, 3}, {3, 4, 5}, {6, 7, 8}};
+
+  const unsigned int dim=3;
+  Tensor<2,dim> t(a);
+
+  deallog << l1_norm(t) << std::endl;
+  t = 0;
+  deallog << l1_norm(t) << std::endl;
+
+  Assert (t.norm() == 0, ExcInternalError());
+
+  deallog << "OK" << std::endl;
+}
diff --git a/tests/base/tensor_04/cmp/generic b/tests/base/tensor_04/cmp/generic
new file mode 100644 (file)
index 0000000..c040c23
--- /dev/null
@@ -0,0 +1,4 @@
+
+DEAL::16.0
+DEAL::0
+DEAL::OK
diff --git a/tests/base/tensor_05.cc b/tests/base/tensor_05.cc
new file mode 100644 (file)
index 0000000..41d7d6f
--- /dev/null
@@ -0,0 +1,43 @@
+//----------------------------  tensor_05.cc  ---------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2006, 2012 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.
+//
+//----------------------------  tensor_05.cc  ---------------------------
+
+// check linfty_norm(Tensor<2,dim>)
+
+#include "../tests.h"
+#include <deal.II/base/tensor.h>
+#include <deal.II/base/logstream.h>
+#include <deal.II/lac/vector.h>
+#include <fstream>
+#include <iomanip>
+
+int main ()
+{
+  std::ofstream logfile("tensor_05/output");
+  deallog << std::setprecision(3);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  double a[3][3] = {{1, 2, 3}, {3, 4, 5}, {6, 7, 8}};
+
+  const unsigned int dim=3;
+  Tensor<2,dim> t(a);
+
+  deallog << linfty_norm(t) << std::endl;
+  t = 0;
+  deallog << linfty_norm(t) << std::endl;
+
+  Assert (t.norm() == 0, ExcInternalError());
+
+  deallog << "OK" << std::endl;
+}
diff --git a/tests/base/tensor_05/cmp/generic b/tests/base/tensor_05/cmp/generic
new file mode 100644 (file)
index 0000000..c61eaaa
--- /dev/null
@@ -0,0 +1,4 @@
+
+DEAL::21.0
+DEAL::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.