]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
I managed to get the determinant wrong...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 6 Apr 2005 18:15:10 +0000 (18:15 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 6 Apr 2005 18:15:10 +0000 (18:15 +0000)
git-svn-id: https://svn.dealii.org/trunk@10395 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/full_tensor_09.cc [new file with mode: 0644]
tests/base/symmetric_tensor_09.cc [new file with mode: 0644]
tests/results/i686-pc-linux-gnu+gcc3.2/base/full_tensor_09.output [new file with mode: 0644]
tests/results/i686-pc-linux-gnu+gcc3.2/base/symmetric_tensor_09.output [new file with mode: 0644]

diff --git a/tests/base/full_tensor_09.cc b/tests/base/full_tensor_09.cc
new file mode 100644 (file)
index 0000000..cc2bb20
--- /dev/null
@@ -0,0 +1,55 @@
+//----------------------------  full_tensor_09.cc  ---------------------------
+//    $Id$
+//    Version: $Name$ 
+//
+//    Copyright (C) 2005 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.
+//
+//----------------------------  full_tensor_09.cc  ---------------------------
+
+// test the determinant code
+
+#include "../tests.h"
+#include <base/tensor.h>
+#include <base/logstream.h>
+#include <fstream>
+#include <iostream>
+
+
+template <int dim>
+void test ()
+{
+  Tensor<2,dim> t;
+
+                                  // choose the same symmetric tensor
+                                  // as in symmetric_tensor_09
+  for (unsigned int i=0; i<dim; ++i)
+    for (unsigned int j=i; j<dim; ++j)
+      t[i][j] = t[j][i] = (1.+(i+1)*(j*2));
+
+  for (unsigned int i=0; i<dim; ++i)
+    for (unsigned int j=0; j<dim; ++j)
+      deallog << i << ' ' << j << ' ' << t[i][j] << std::endl;
+  
+  deallog << determinant(t) << std::endl;
+}
+
+  
+
+
+int main ()
+{
+  std::ofstream logfile("full_tensor_09.output");
+  logfile.precision(3);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+
+  test<2> ();
+  test<3> ();
+  
+  deallog << "OK" << std::endl;
+}
diff --git a/tests/base/symmetric_tensor_09.cc b/tests/base/symmetric_tensor_09.cc
new file mode 100644 (file)
index 0000000..bb36263
--- /dev/null
@@ -0,0 +1,52 @@
+//----------------------------  symmetric_tensor_09.cc  ---------------------------
+//    $Id$
+//    Version: $Name$ 
+//
+//    Copyright (C) 2005 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.
+//
+//----------------------------  symmetric_tensor_09.cc  ---------------------------
+
+// test the determinant code
+
+#include "../tests.h"
+#include <base/symmetric_tensor.h>
+#include <base/logstream.h>
+#include <fstream>
+#include <iostream>
+
+
+template <int dim>
+void test ()
+{
+  SymmetricTensor<2,dim> t;
+  for (unsigned int i=0; i<dim; ++i)
+    for (unsigned int j=i; j<dim; ++j)
+      t[i][j] = (1.+(i+1)*(j*2));
+
+  for (unsigned int i=0; i<dim; ++i)
+    for (unsigned int j=0; j<dim; ++j)
+      deallog << i << ' ' << j << ' ' << t[i][j] << std::endl;
+  
+  deallog << determinant(t) << std::endl;
+}
+
+  
+
+
+int main ()
+{
+  std::ofstream logfile("symmetric_tensor_09.output");
+  logfile.precision(3);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+
+  test<2> ();
+  test<3> ();
+  
+  deallog << "OK" << std::endl;
+}
diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/base/full_tensor_09.output b/tests/results/i686-pc-linux-gnu+gcc3.2/base/full_tensor_09.output
new file mode 100644 (file)
index 0000000..31cd90f
--- /dev/null
@@ -0,0 +1,17 @@
+
+DEAL::0 0 1.00
+DEAL::0 1 3.00
+DEAL::1 0 3.00
+DEAL::1 1 5.00
+DEAL::-4.00
+DEAL::0 0 1.00
+DEAL::0 1 3.00
+DEAL::0 2 5.00
+DEAL::1 0 3.00
+DEAL::1 1 5.00
+DEAL::1 2 9.00
+DEAL::2 0 5.00
+DEAL::2 1 9.00
+DEAL::2 2 13.0
+DEAL::12.0
+DEAL::OK
diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/base/symmetric_tensor_09.output b/tests/results/i686-pc-linux-gnu+gcc3.2/base/symmetric_tensor_09.output
new file mode 100644 (file)
index 0000000..31cd90f
--- /dev/null
@@ -0,0 +1,17 @@
+
+DEAL::0 0 1.00
+DEAL::0 1 3.00
+DEAL::1 0 3.00
+DEAL::1 1 5.00
+DEAL::-4.00
+DEAL::0 0 1.00
+DEAL::0 1 3.00
+DEAL::0 2 5.00
+DEAL::1 0 3.00
+DEAL::1 1 5.00
+DEAL::1 2 9.00
+DEAL::2 0 5.00
+DEAL::2 1 9.00
+DEAL::2 2 13.0
+DEAL::12.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.