]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Finally produce something reasonable.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 8 Nov 1999 12:08:40 +0000 (12:08 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 8 Nov 1999 12:08:40 +0000 (12:08 +0000)
git-svn-id: https://svn.dealii.org/trunk@1840 0785d39b-7218-0410-832d-ea1e28bc413d

tests/deal.II/second_derivatives.cc

index 412a5b040960c635c5eaccc79d7888a29856baa8..8afaa7d7c7ee098afa46be84b3bc7eb0986a16b0 100644 (file)
@@ -40,7 +40,6 @@ int main () {
                                   // shape functions. first loop:
                                   // unit cell, second loop:
                                   // one vertex moved
-  bool testcase_succeeded = true;
   for (unsigned int loop=0; loop<2; ++loop)
     {
       cout << "Test loop: " << loop << endl
@@ -59,128 +58,12 @@ int main () {
          vector<Tensor<2,2> > derivs(4);
          fevalues.get_function_2nd_derivatives (val, derivs);
          
-         cout << "  Vertex " << vertex << ": ";
-         switch (loop)
-           {
-             case 0:
-                   for (unsigned int point=0; point<4; ++point)
-                     {
-                                                        // on the unit cell,
-                       bool ok=true;
-
-                       if ((derivs[point][0][0] != 0) ||
-                           (derivs[point][1][1] != 0))
-                         ok = false;
-
-                       switch (vertex)
-                         {
-                           case 0:
-                           case 2:
-                                 if ((derivs[point][0][1] != 1) ||
-                                     (derivs[point][1][0] != 1))
-                                   ok = false;
-                                 break;
-                           case 1:
-                           case 3:
-                                 if ((derivs[point][0][1] != -1) ||
-                                     (derivs[point][1][0] != -1))
-                                   ok = false;
-                                 break;
-                         };  
-                       
-                       if (!ok)
-                         {
-                           testcase_succeeded = false;
-                           cout << "WRONG! ";
-                         }
-                       else
-                         cout << "OK ";
-                     };
-                   break;
-
-             case 1:
-                                                    // are these numbers ok?
-                                                    // I have never checked
-                                                    // them, exept for the
-                                                    // symmetry of the tensors
-                                                    // and some of the signs of
-                                                    // the entries! Someone
-                                                    // should really try to
-                                                    // verify at least
-                                                    // some of the numbers
-                   static double _true_value[4][4][2][2]
-                     = { { {{0,1},
-                            {1,0}},
-                           {{0,0},
-                            {0,0}},
-                           {{0,1},
-                            {1,-2}},
-                           {{0,0},
-                            {0,0}}  },
-                         { {{0,-1},
-                            {-1,0}},
-                           {{0,0},
-                            {0,0}},
-                           {{0,-1},
-                            {-1,2}},
-                           {{0,0},
-                            {0,0}}  },
-                         { {{0,0},
-                            {0,0}},
-                           {{0,-.25},
-                            {-.25,0}},
-                           {{0,0},
-                            {0,0}},
-                           {{0,-.25},
-                            {-.25,0.5}}  },
-                         { {{0,0},
-                            {0,0}},
-                           {{0,.25},
-                            {.25,0}},
-                           {{0,0},
-                            {0,0}},
-                           {{0,.25},
-                            {.25,-.5}}  }  };
-                   static Tensor<2,2> true_value[4][4]
-                     = {{ Tensor<2,2>(_true_value[0][0]),
-                          Tensor<2,2>(_true_value[0][1]),
-                          Tensor<2,2>(_true_value[0][2]),
-                          Tensor<2,2>(_true_value[0][3])  },
-                        { Tensor<2,2>(_true_value[1][0]),
-                          Tensor<2,2>(_true_value[1][1]),
-                          Tensor<2,2>(_true_value[1][2]),
-                          Tensor<2,2>(_true_value[1][3])  },
-                        { Tensor<2,2>(_true_value[2][0]),
-                          Tensor<2,2>(_true_value[2][1]),
-                          Tensor<2,2>(_true_value[2][2]),
-                          Tensor<2,2>(_true_value[2][3])  },
-                        { Tensor<2,2>(_true_value[3][0]),
-                          Tensor<2,2>(_true_value[3][1]),
-                          Tensor<2,2>(_true_value[3][2]),
-                          Tensor<2,2>(_true_value[3][3])  }};
-                   
-                   for (unsigned int point=0; point<4; ++point)
-                     {
-                       if (derivs[point] != true_value[vertex][point])
-                         {
-                           testcase_succeeded = false;
-                           cout << "WRONG! ";
-                         }
-                       else
-                         cout << "OK ";
-                     };
-                   break;
-           };
-
+         cout << "Vertex " << vertex << ": " << endl;
+         for (unsigned int point=0; point<4; ++point)
+           for (unsigned int component=0; component<2; ++component)
+             cout << derivs[point][component] << endl;
+         
          cout << endl;
        };
     };
-  
-
-  cout << "------------------------------------------------------" << endl;
-
-  if (testcase_succeeded)
-    return 0;
-  else
-    return 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.