From: kanschat Date: Thu, 20 Sep 2007 21:27:17 +0000 (+0000) Subject: check StokesLSingulartity X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b38ebbfda7ff6a2824134a0674846bbbfcfa9d03;p=dealii-svn.git check StokesLSingulartity git-svn-id: https://svn.dealii.org/trunk@15225 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/functions_01.cc b/tests/base/functions_01.cc index ed1298b327..339ee483b2 100644 --- a/tests/base/functions_01.cc +++ b/tests/base/functions_01.cc @@ -120,13 +120,13 @@ check_function(const Functions::FlowFunction& f, deallog << "Gradients "; // Compute gradients and difference approximations std::vector > > - gradients(points.size(), std::vector >(f.n_components)); + gradients(f.n_components, std::vector >(points.size())); std::vector > > gradients1(points.size(), std::vector >(f.n_components)); std::vector > > gradients2(points.size(), std::vector >(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& f, for (unsigned int i=0;i 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& 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, // Check if divergence is zero deallog << "Divergence "; - for (unsigned int k=0;k 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) diff --git a/tests/base/functions_01/cmp/generic b/tests/base/functions_01/cmp/generic index 1ff91be864..c4c1d38009 100644 --- a/tests/base/functions_01/cmp/generic +++ b/tests/base/functions_01/cmp/generic @@ -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. +# +# +-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