]> https://gitweb.dealii.org/ - dealii.git/commitdiff
New tests
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 24 Mar 2006 20:35:21 +0000 (20:35 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 24 Mar 2006 20:35:21 +0000 (20:35 +0000)
git-svn-id: https://svn.dealii.org/trunk@12673 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/Makefile
tests/base/symmetric_tensor_20.cc [new file with mode: 0644]
tests/base/symmetric_tensor_20/cmp/generic [new file with mode: 0644]
tests/base/symmetric_tensor_21.cc [new file with mode: 0644]
tests/base/symmetric_tensor_21/cmp/generic [new file with mode: 0644]
tests/base/tensor_02.cc [new file with mode: 0644]
tests/base/tensor_02/cmp/generic [new file with mode: 0644]
tests/base/tensor_03.cc [new file with mode: 0644]
tests/base/tensor_03/cmp/generic [new file with mode: 0644]

index 08e4ce2698579db80e4fb8eb69a4fa7994d0972d..da984a95c355e3489b21417b1a786301285b9c89 100644 (file)
@@ -30,6 +30,7 @@ tests_x =  logtest \
           slice_vector \
           table \
           tensor \
+          tensor_* \
           symmetric_tensor_* \
           full_tensor_* \
            timer \
diff --git a/tests/base/symmetric_tensor_20.cc b/tests/base/symmetric_tensor_20.cc
new file mode 100644 (file)
index 0000000..69d5f31
--- /dev/null
@@ -0,0 +1,41 @@
+//----------------------------  symmetric_tensor_20.cc  ---------------------------
+//    $Id$
+//    Version: $Name$ 
+//
+//    Copyright (C) 2006 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_20.cc  ---------------------------
+
+// check SymmetricTensor<2,dim>::operator= (double)
+
+#include <base/symmetric_tensor.h>
+#include <base/logstream.h>
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+
+int main ()
+{
+  std::ofstream logfile("symmetric_tensor_20/output");
+  logfile.precision(3);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+  
+  const unsigned int dim=3;
+  SymmetricTensor<2,dim> t;
+  t[0][0] = t[1][0] = t[1][1] = t[2][2] = 3;
+
+  deallog << t.norm() << std::endl;
+  t = 0;
+  deallog << t.norm() << std::endl;
+
+  Assert (t.norm() == 0, ExcInternalError());
+  
+  deallog << "OK" << std::endl;
+}
diff --git a/tests/base/symmetric_tensor_20/cmp/generic b/tests/base/symmetric_tensor_20/cmp/generic
new file mode 100644 (file)
index 0000000..2f6e72a
--- /dev/null
@@ -0,0 +1,4 @@
+
+DEAL::6.71
+DEAL::0
+DEAL::OK
diff --git a/tests/base/symmetric_tensor_21.cc b/tests/base/symmetric_tensor_21.cc
new file mode 100644 (file)
index 0000000..ee86991
--- /dev/null
@@ -0,0 +1,42 @@
+//----------------------------  symmetric_tensor_21.cc  ---------------------------
+//    $Id$
+//    Version: $Name$ 
+//
+//    Copyright (C) 2006 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_21.cc  ---------------------------
+
+// check SymmetricTensor<2,dim>::operator= (double)
+
+#include <base/symmetric_tensor.h>
+#include <base/logstream.h>
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+
+int main ()
+{
+  std::ofstream logfile("symmetric_tensor_21/output");
+  logfile.precision(3);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+  
+  const unsigned int dim=3;
+  SymmetricTensor<4,dim> t;
+  t[0][0][0][0] = t[1][0][1][0] = t[1][1][1][1]
+                = t[2][2][2][2] = t[2][0][2][0] = 3;
+
+  deallog << t.norm() << std::endl;
+  t = 0;
+  deallog << t.norm() << std::endl;
+
+  Assert (t.norm() == 0, ExcInternalError());
+  
+  deallog << "OK" << std::endl;
+}
diff --git a/tests/base/symmetric_tensor_21/cmp/generic b/tests/base/symmetric_tensor_21/cmp/generic
new file mode 100644 (file)
index 0000000..db9438b
--- /dev/null
@@ -0,0 +1,4 @@
+
+DEAL::9.95
+DEAL::0
+DEAL::OK
diff --git a/tests/base/tensor_02.cc b/tests/base/tensor_02.cc
new file mode 100644 (file)
index 0000000..255df37
--- /dev/null
@@ -0,0 +1,42 @@
+//----------------------------  tensor_02.cc  ---------------------------
+//    $Id$
+//    Version: $Name$ 
+//
+//    Copyright (C) 2006 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_02.cc  ---------------------------
+
+// check Tensor::operator= (double)
+
+#include <base/tensor.h>
+#include <base/logstream.h>
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+
+int main ()
+{
+  std::ofstream logfile("tensor_02/output");
+  logfile.precision(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 << t.norm() << std::endl;
+  t = 0;
+  deallog << t.norm() << std::endl;
+
+  Assert (t.norm() == 0, ExcInternalError());
+  
+  deallog << "OK" << std::endl;
+}
diff --git a/tests/base/tensor_02/cmp/generic b/tests/base/tensor_02/cmp/generic
new file mode 100644 (file)
index 0000000..4931f44
--- /dev/null
@@ -0,0 +1,4 @@
+
+DEAL::14.6
+DEAL::0
+DEAL::OK
diff --git a/tests/base/tensor_03.cc b/tests/base/tensor_03.cc
new file mode 100644 (file)
index 0000000..901e234
--- /dev/null
@@ -0,0 +1,42 @@
+//----------------------------  tensor_03.cc  ---------------------------
+//    $Id$
+//    Version: $Name$ 
+//
+//    Copyright (C) 2006 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_03.cc  ---------------------------
+
+// check Tensor<1,dim>::operator= (double)
+
+#include <base/tensor.h>
+#include <base/logstream.h>
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+
+int main ()
+{
+  std::ofstream logfile("tensor_03/output");
+  logfile.precision(3);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+  
+  double a[3] = {1, 2, 3};
+    
+  const unsigned int dim=3;
+  Tensor<1,dim> t(a);
+
+  deallog << t.norm() << std::endl;
+  t = 0;
+  deallog << t.norm() << std::endl;
+
+  Assert (t.norm() == 0, ExcInternalError());
+  
+  deallog << "OK" << std::endl;
+}
diff --git a/tests/base/tensor_03/cmp/generic b/tests/base/tensor_03/cmp/generic
new file mode 100644 (file)
index 0000000..4c40f1b
--- /dev/null
@@ -0,0 +1,4 @@
+
+DEAL::3.74
+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.