]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
check StokesLSingulartity
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 20 Sep 2007 21:27:17 +0000 (21:27 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 20 Sep 2007 21:27:17 +0000 (21:27 +0000)
git-svn-id: https://svn.dealii.org/trunk@15225 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/functions_01.cc
tests/base/functions_01/cmp/generic

index ed1298b3275ad3b934e8e22f1b0a7b0c809761da..339ee483b2cecfaa813c1275eae22d4d3567ff40 100644 (file)
@@ -120,13 +120,13 @@ check_function(const Functions::FlowFunction<dim>& f,
   deallog << "Gradients ";
                                   // Compute gradients and difference approximations
   std::vector<std::vector<Tensor<1,dim> > >
-    gradients(points.size(), std::vector<Tensor<1,dim> >(f.n_components));
+    gradients(f.n_components, std::vector<Tensor<1,dim> >(points.size()));
   std::vector<std::vector<Tensor<1,dim> > >
     gradients1(points.size(), std::vector<Tensor<1,dim> >(f.n_components));
   std::vector<std::vector<Tensor<1,dim> > >
     gradients2(points.size(), std::vector<Tensor<1,dim> >(f.n_components));
   
-  f.vector_gradient_list(points, gradients);
+  f.vector_gradients(points, gradients);
   dtest1.vector_gradient_list(points, gradients1);
   dtest2.vector_gradient_list(points, gradients2);
 
@@ -135,8 +135,8 @@ check_function(const Functions::FlowFunction<dim>& f,
     for (unsigned int i=0;i<gradients[k].size();++i)
       {
                                         // Compute difference
-       Tensor<1,dim> d1 = gradients1[k][i] - gradients[k][i];
-       Tensor<1,dim> d2 = gradients2[k][i] - gradients[k][i];
+       Tensor<1,dim> d1 = gradients1[i][k] - gradients[k][i];
+       Tensor<1,dim> d2 = gradients2[i][k] - gradients[k][i];
        
                                         // If the difference is
                                         // already small, we are fine
@@ -150,15 +150,16 @@ check_function(const Functions::FlowFunction<dim>& f,
                                             // bit generous
            if (d2.norm() < 12.* d1.norm())
              {
-               deallog << "Gradient error: point " << k << " comp " << i
-                       << " norms " << d1.norm() << " " << d2.norm()
+               deallog << "Gradient error: point " << i
+                       << " (" << points[i] << " )"
+                       << " comp " << k
+//                     << " norms " << d1.norm() << " " << d2.norm()
                        << std::endl;
-//             for (unsigned int i=0;i<f.n_components;++i)
-                 for (unsigned int d=0;d<dim;++d)
-                   deallog
-                     << " " << gradients[k][i][d]
-                     << " " << gradients1[k][i][d]
-                     << std::endl;
+               for (unsigned int d=0;d<dim;++d)
+                 deallog
+                   << " " << gradients[k][i][d]
+                   << " " << gradients1[i][k][d]
+                   << std::endl;
              }
          }
       }
@@ -167,11 +168,11 @@ check_function(const Functions::FlowFunction<dim>& f,
                                   // Check if divergence is zero
   deallog << "Divergence ";
   
-  for (unsigned int k=0;k<gradients.size();++k)
+  for (unsigned int k=0;k<points.size();++k)
     {
       double div = 0.;
       for (unsigned int d=0;d<dim;++d)
-       div += gradients[k][d][d];
+       div += gradients[d][k][d];
       if (std::fabs(div)> 1.e-13)
        deallog << "Divergence " << k << " "
                << div << std::endl;
@@ -226,11 +227,14 @@ int main()
       check_function(f, 4, logfile);
     }
 
-  if (false)
+  if (true)
     {
       deallog << "Functions::StokesLSingularity" << std::endl;
       Functions::StokesLSingularity f;
-      check_function(f, 4, logfile);
+                                      // Use odd number of points to
+                                      // avoid lines with
+                                      // discontinuous derivatives.
+      check_function(f, 5, logfile);
     }
 
   if (true)
index 1ff91be864bbc7b8918794d9476a466f9be061bb..c4c1d38009b947a4b5e8d7167d74f7cfc348d8e6 100644 (file)
@@ -372,6 +372,60 @@ component "connections" value "cells"
 component "data" value "data"
 attribute 
 end
+DEAL::Functions::StokesLSingularity
+DEAL::Gradients tested
+DEAL::Divergence tested
+DEAL::Laplacians 0
+# This file was generated by the deal.II library.
+
+
+#
+# For a description of the GNUPLOT format see the GNUPLOT manual.
+#
+# <x> <y> <comp> <comp> <comp> 
+-1.00000 -1.00000 4.26453 -4.26453 0.00000 
+-0.600000 -1.00000 4.09873 -3.41727 -0.473831 
+-0.200000 -1.00000 3.84003 -2.45659 -1.19703 
+0.200000 -1.00000 3.41329 -1.55228 -1.95790 
+0.600000 -1.00000 2.90816 -0.922336 -2.41631 
+1.00000 -1.00000 2.47239 -0.566216 -2.55657 
+
+-1.00000 -0.600000 3.41727 -4.09873 0.473831 
+-0.600000 -0.600000 3.22908 -3.22908 0.00000 
+-0.200000 -0.600000 2.98575 -2.10725 -1.17869 
+0.200000 -0.600000 2.45684 -0.989538 -2.71696 
+0.600000 -0.600000 1.87208 -0.428735 -3.22637 
+1.00000 -0.600000 1.49487 -0.221862 -3.13156 
+
+-1.00000 -0.200000 2.45659 -3.84003 1.19703 
+-0.600000 -0.200000 2.10725 -2.98575 1.17869 
+-0.200000 -0.200000 1.77539 -1.77539 0.00000 
+0.200000 -0.200000 1.02929 -0.235724 -5.32170 
+0.600000 -0.200000 0.609245 -0.0505464 -4.49620 
+1.00000 -0.200000 0.467523 -0.0228120 -3.76482 
+
+-1.00000 0.200000 1.55228 -3.41329 1.95790 
+-0.600000 0.200000 0.989538 -2.45684 2.71696 
+-0.200000 0.200000 0.235724 -1.02929 5.32170 
+0.200000 0.200000 0.00000 0.00000 0.00000 
+0.600000 0.200000 0.00000 0.00000 0.00000 
+1.00000 0.200000 0.00000 0.00000 0.00000 
+
+-1.00000 0.600000 0.922336 -2.90816 2.41631 
+-0.600000 0.600000 0.428735 -1.87208 3.22637 
+-0.200000 0.600000 0.0505464 -0.609245 4.49620 
+0.200000 0.600000 0.00000 0.00000 0.00000 
+0.600000 0.600000 0.00000 0.00000 0.00000 
+1.00000 0.600000 0.00000 0.00000 0.00000 
+
+-1.00000 1.00000 0.566216 -2.47239 2.55657 
+-0.600000 1.00000 0.221862 -1.49487 3.13156 
+-0.200000 1.00000 0.0228120 -0.467523 3.76482 
+0.200000 1.00000 0.00000 0.00000 0.00000 
+0.600000 1.00000 0.00000 0.00000 0.00000 
+1.00000 1.00000 0.00000 0.00000 0.00000 
+
+
 DEAL::Functions::PoisseuilleFlow<2>
 DEAL::Gradients tested
 DEAL::Divergence tested

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.