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);
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
// 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;
}
}
}
// 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;
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)
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