From: Wolfgang Bangerth Date: Wed, 30 Mar 2005 17:30:10 +0000 (+0000) Subject: operator* doesn't do complete contractions of tensors of rank 4 any more. X-Git-Tag: v8.0.0~14226 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0918742a8d8ff2c337ffe3b0433e0e9c9c71ca57;p=dealii.git operator* doesn't do complete contractions of tensors of rank 4 any more. git-svn-id: https://svn.dealii.org/trunk@10321 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/symmetric_tensor_03.cc b/tests/base/symmetric_tensor_03.cc index 72d35a9b45..5c43cd5fc1 100644 --- a/tests/base/symmetric_tensor_03.cc +++ b/tests/base/symmetric_tensor_03.cc @@ -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; diff --git a/tests/base/symmetric_tensor_04.cc b/tests/base/symmetric_tensor_04.cc index 9a6af12cd7..93e16f6fe2 100644 --- a/tests/base/symmetric_tensor_04.cc +++ b/tests/base/symmetric_tensor_04.cc @@ -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;