]> https://gitweb.dealii.org/ - dealii.git/commitdiff
operator* doesn't do complete contractions of tensors of rank 4 any more.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 30 Mar 2005 17:30:10 +0000 (17:30 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 30 Mar 2005 17:30:10 +0000 (17:30 +0000)
git-svn-id: https://svn.dealii.org/trunk@10321 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/symmetric_tensor_03.cc
tests/base/symmetric_tensor_04.cc

index 72d35a9b45cea1e3648bdf0b0bd45649e0f0a996..5c43cd5fc1b52714828d695e05f3f5344e8716e4 100644 (file)
@@ -48,7 +48,14 @@ int main ()
 
                                    // make sure norm is induced by scalar
                                    // product
-  Assert (std::fabs (t.norm()*t.norm() - t*t) < 1e-14,
+  double norm_sqr = 0;
+  for (unsigned int i=0; i<2; ++i)
+    for (unsigned int j=0; j<2; ++j)
+      for (unsigned int k=0; k<2; ++k)
+       for (unsigned int l=0; l<2; ++l)
+         norm_sqr += t[i][j][k][l] * t[i][j][k][l];
+  
+  Assert (std::fabs (t.norm()*t.norm() - norm_sqr) < 1e-14,
           ExcInternalError());
 
   deallog << "OK" << std::endl;
index 9a6af12cd7995470c8e8384ad6eca8dc58df3dbb..93e16f6fe20592d41e4ac6934aed9d3869496409 100644 (file)
@@ -48,7 +48,13 @@ int main ()
 
                                    // make sure norm is induced by scalar
                                    // product
-  Assert (std::fabs (t.norm()*t.norm() - t*t) < 1e-14,
+  double norm_sqr = 0;
+  for (unsigned int i=0; i<2; ++i)
+    for (unsigned int j=0; j<2; ++j)
+      for (unsigned int k=0; k<2; ++k)
+       for (unsigned int l=0; l<2; ++l)
+         norm_sqr += t[i][j][k][l] * t[i][j][k][l];
+  Assert (std::fabs (t.norm()*t.norm() - norm_sqr) < 1e-14,
           ExcInternalError());
 
   deallog << "OK" << std::endl;

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.