--- /dev/null
+//---------------------------- symmetric_tensor_01.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_01.cc ---------------------------
+
+
+#include "../tests.h"
+#include <base/symmetric_tensor.h>
+#include <base/logstream.h>
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+
+int main ()
+{
+ std::ofstream logfile("symmetric_tensor_01.output");
+ logfile.precision(3);
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+
+ SymmetricTensor<2,2> t2;
+ t2[0][0] = 1;
+ t2[1][1] = 2;
+ t2[0][1] = 3;
+
+ Assert (t2[0][1] == t2[1][0], ExcInternalError());
+
+ // check that if a single element is
+ // accessed, its transpose element gets the
+ // same value
+ t2[1][0] = 4;
+ Assert (t2[0][1] == 4, ExcInternalError());
+
+ // make sure transposition doesn't change
+ // anything
+ Assert (t2 == transpose(t2), ExcInternalError());
+
+ // check norm of tensor
+ Assert (std::fabs(t2.norm() - std::sqrt(1.*1+2*2+2*4*4)) < 1e-14,
+ ExcInternalError());
+
+ // make sure norm is induced by scalar
+ // product
+ Assert (std::fabs (t2.norm()*t2.norm() - t2*t2) < 1e-14,
+ ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}