]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Work-around due to internal compiler error of gcc3.4.3
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 13 Apr 2005 14:16:04 +0000 (14:16 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 13 Apr 2005 14:16:04 +0000 (14:16 +0000)
git-svn-id: https://svn.dealii.org/trunk@10476 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/symmetric_tensor_08.cc

index 570a12da916ee05dfec30d05342d683f2dd95735..541c45943c714e10fb5005e6522624456e6b7953 100644 (file)
 #include <fstream>
 #include <iostream>
 
-  
+
+inline
+double value(unsigned int i,
+            unsigned int j,
+            unsigned int k,
+            unsigned int l,
+            double lambda,
+            double mu)
+{
+  return ((i==k) && (j==l) ? mu : 0) +
+        ((i==l) && (j==k) ? mu : 0) +
+        ((i==j) && (k==l) ? lambda : 0);
+}
+
+
 
 template <int dim>
 void test ()
@@ -32,11 +46,9 @@ void test ()
     for (unsigned int j=0; j<dim; ++j)
       for (unsigned int k=0; k<dim; ++k)
        for (unsigned int l=0; l<dim; ++l)
-         t[i][j][k][l] = (((i==k) && (j==l) ? mu : 0) +
-                          ((i==l) && (j==k) ? mu : 0) +
-                          ((i==j) && (k==l) ? lambda : 0));
-         
-  SymmetricTensor<2,dim> a, b;
+         t[i][j][k][l] = value(i,j,k,l,lambda,mu);
+  
+  SymmetricTensor<2,dim> a;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       a[i][j] = (1. + (i+1)*(j+1));

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.