--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2016 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 that we can convert a SymmetricTensor<4,dim> to a Tensor<4,dim>
+
+#include "../tests.h"
+#include <deal.II/base/symmetric_tensor.h>
+#include <deal.II/base/logstream.h>
+
+
+template <int dim>
+void initialize (SymmetricTensor<2,dim> &st)
+{
+ for (unsigned int i=0; i<dim; ++i)
+ for (unsigned int j=i; j<dim; ++j)
+ st[i][j] = (i+1)*dim + (j-i);
+}
+
+
+template <int dim>
+void initialize (SymmetricTensor<4,dim> &st)
+{
+ for (unsigned int i=0; i<dim; ++i)
+ for (unsigned int j=i; j<dim; ++j)
+ for (unsigned int k=0; k<dim; ++k)
+ for (unsigned int l=k; l<dim; ++l)
+ st[i][j][k][l] = (i+1)*dim + (j-i) + (k+1)*dim + (l-k);
+}
+
+
+
+template <int rank, int dim>
+void check ()
+{
+ // build a regular tensor
+ SymmetricTensor<rank,dim> st;
+ initialize (st);
+ deallog << "st=" << st << std::endl;
+
+ Tensor<rank,dim> t (st); // check conversion constructor
+ deallog << "t =" << t << std::endl;
+
+ t = st; // check assignment operator
+ deallog << "t =" << t << std::endl;
+}
+
+
+int main ()
+{
+ std::ofstream logfile("output");
+ deallog << std::setprecision(3);
+ deallog.attach(logfile);
+ deallog.threshold_double(1.e-10);
+
+ deallog << "checking rank 2 tensors" << std::endl;
+ check<2,1>();
+ check<2,2>();
+ check<2,3>();
+
+ deallog << "checking rank 4 tensors" << std::endl;
+ check<4,1>();
+ check<4,2>();
+ check<4,3>();
+
+ deallog << "OK" << std::endl;
+}
--- /dev/null
+
+DEAL::checking rank 2 tensors
+DEAL::st=1.00
+DEAL::t =1.00
+DEAL::t =1.00
+DEAL::st=2.00 3.00 3.00 4.00
+DEAL::t =2.00 3.00 3.00 4.00
+DEAL::t =2.00 3.00 3.00 4.00
+DEAL::st=3.00 4.00 5.00 4.00 6.00 7.00 5.00 7.00 9.00
+DEAL::t =3.00 4.00 5.00 4.00 6.00 7.00 5.00 7.00 9.00
+DEAL::t =3.00 4.00 5.00 4.00 6.00 7.00 5.00 7.00 9.00
+DEAL::checking rank 4 tensors
+DEAL::st=2.00
+DEAL::t =2.00
+DEAL::t =2.00
+DEAL::st=4.00 5.00 5.00 6.00 5.00 6.00 6.00 7.00 5.00 6.00 6.00 7.00 6.00 7.00 7.00 8.00
+DEAL::t =4.00 5.00 5.00 6.00 5.00 6.00 6.00 7.00 5.00 6.00 6.00 7.00 6.00 7.00 7.00 8.00
+DEAL::t =4.00 5.00 5.00 6.00 5.00 6.00 6.00 7.00 5.00 6.00 6.00 7.00 6.00 7.00 7.00 8.00
+DEAL::st=6.00 7.00 8.00 7.00 9.00 10.0 8.00 10.0 12.0 7.00 8.00 9.00 8.00 10.0 11.0 9.00 11.0 13.0 8.00 9.00 10.0 9.00 11.0 12.0 10.0 12.0 14.0 7.00 8.00 9.00 8.00 10.0 11.0 9.00 11.0 13.0 9.00 10.0 11.0 10.0 12.0 13.0 11.0 13.0 15.0 10.0 11.0 12.0 11.0 13.0 14.0 12.0 14.0 16.0 8.00 9.00 10.0 9.00 11.0 12.0 10.0 12.0 14.0 10.0 11.0 12.0 11.0 13.0 14.0 12.0 14.0 16.0 12.0 13.0 14.0 13.0 15.0 16.0 14.0 16.0 18.0
+DEAL::t =6.00 7.00 8.00 7.00 9.00 10.0 8.00 10.0 12.0 7.00 8.00 9.00 8.00 10.0 11.0 9.00 11.0 13.0 8.00 9.00 10.0 9.00 11.0 12.0 10.0 12.0 14.0 7.00 8.00 9.00 8.00 10.0 11.0 9.00 11.0 13.0 9.00 10.0 11.0 10.0 12.0 13.0 11.0 13.0 15.0 10.0 11.0 12.0 11.0 13.0 14.0 12.0 14.0 16.0 8.00 9.00 10.0 9.00 11.0 12.0 10.0 12.0 14.0 10.0 11.0 12.0 11.0 13.0 14.0 12.0 14.0 16.0 12.0 13.0 14.0 13.0 15.0 16.0 14.0 16.0 18.0
+DEAL::t =6.00 7.00 8.00 7.00 9.00 10.0 8.00 10.0 12.0 7.00 8.00 9.00 8.00 10.0 11.0 9.00 11.0 13.0 8.00 9.00 10.0 9.00 11.0 12.0 10.0 12.0 14.0 7.00 8.00 9.00 8.00 10.0 11.0 9.00 11.0 13.0 9.00 10.0 11.0 10.0 12.0 13.0 11.0 13.0 15.0 10.0 11.0 12.0 11.0 13.0 14.0 12.0 14.0 16.0 8.00 9.00 10.0 9.00 11.0 12.0 10.0 12.0 14.0 10.0 11.0 12.0 11.0 13.0 14.0 12.0 14.0 16.0 12.0 13.0 14.0 13.0 15.0 16.0 14.0 16.0 18.0
+DEAL::OK