]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix compute_global_error() 2636/head
authorTimo Heister <timo.heister@gmail.com>
Wed, 25 May 2016 14:55:02 +0000 (15:55 +0100)
committerTimo Heister <timo.heister@gmail.com>
Thu, 26 May 2016 09:06:14 +0000 (10:06 +0100)
- Fix parallel loop over cells in compute_global_error.
- Change tests to trigger bug that is now fixed.

include/deal.II/numerics/vector_tools.templates.h
tests/mpi/integrate_difference.cc
tests/vector_tools/integrate_difference_03.cc
tests/vector_tools/integrate_difference_03.with_trilinos=true.with_p4est=true.mpirun=1.output
tests/vector_tools/integrate_difference_03.with_trilinos=true.with_p4est=truempirun=3.output
tests/vector_tools/integrate_difference_04.cc
tests/vector_tools/integrate_difference_04.with_trilinos=true.with_metis=true.mpirun=1.output
tests/vector_tools/integrate_difference_04.with_trilinos=true.with_metis=true.mpirun=3.output

index 3bc45d83253cfb01a1e1108ddc8a46e11af47467..f5c046b61c2f82eee8406a637b98ef5000abaf0e 100644 (file)
@@ -6675,7 +6675,7 @@ namespace VectorTools
       // check that off-processor entries are zero. Otherwise we will compute
       // wrong results below!
       typename InVector::size_type i = 0;
-      typename Triangulation<dim,spacedim>::cell_iterator it = tria.begin_active();
+      typename Triangulation<dim,spacedim>::active_cell_iterator it = tria.begin_active();
       for (; i<cellwise_error.size(); ++i, ++it)
         if (!it->is_locally_owned())
           Assert(std::fabs(cellwise_error[i]) <  1e-20,
@@ -6739,7 +6739,7 @@ namespace VectorTools
       {
         double local = 0;
         typename InVector::size_type i;
-        typename Triangulation<dim,spacedim>::cell_iterator it = tria.begin_active();
+        typename Triangulation<dim,spacedim>::active_cell_iterator it = tria.begin_active();
         for (i = 0; i<cellwise_error.size(); ++i, ++it)
           if (it->is_locally_owned())
             local += std::pow(cellwise_error[i], exponent);
index cc9bf9d7d44fe2f7f6f0a32287a8173fc7197575..233373c8fc33a2d793f5bd815bde7eb7c7d46e77 100644 (file)
@@ -59,7 +59,7 @@ void test()
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
   GridGenerator::hyper_cube(tr);
-  tr.refine_global (2);
+  tr.refine_global (3);
 
   const FE_Q<dim> fe(2);
   DoFHandler<dim> dofh(tr);
index 40a767353951fc5ac623db07ff3fa22f4b7c2961..731c9ffa92360715fdde7a447d097c64d876ad7d 100644 (file)
@@ -64,7 +64,7 @@ void test(VectorTools::NormType norm, double value, double exp = 2.0)
 {
   parallel::distributed::Triangulation<dim> tria(MPI_COMM_WORLD);
   GridGenerator::hyper_cube(tria);
-  tria.refine_global(2);
+  tria.refine_global(3);
 
   FESystem<dim> fe(FE_Q<dim>(4),dim);
   DoFHandler<dim> dofh(tria);
index d8f0ac1c2a79c8e6e8196a8b85d3de3672009ca6..d207d6bd5048764072b9eff191c63cdf61d042be 100644 (file)
@@ -1,20 +1,20 @@
 
 DEAL:0::Hdiv_seminorm:
-DEAL:0::computed: 3.05532 expected: 3.05505 difference: 0.000272760
+DEAL:0::computed: 3.05512 expected: 3.05505 difference: 6.81923e-05
 DEAL:0::L2_norm:
-DEAL:0::computed: 1.95470 expected: 1.95363 difference: 0.00106613
+DEAL:0::computed: 1.95390 expected: 1.95363 difference: 0.000266581
 DEAL:0::H1_seminorm:
-DEAL:0::computed: 2.70878 expected: 2.70801 difference: 0.000769213
+DEAL:0::computed: 2.70821 expected: 2.70801 difference: 0.000192324
 DEAL:0::H1_norm:
-DEAL:0::computed: 3.34041 expected: 3.33916 difference: 0.00124760
+DEAL:0::computed: 3.33947 expected: 3.33916 difference: 0.000311941
 DEAL:0::L1_norm:
-DEAL:0::computed: 2.91750 expected: 2.91667 difference: 0.000833333
+DEAL:0::computed: 2.91688 expected: 2.91667 difference: 0.000208333
 DEAL:0::Linfty_norm:
 DEAL:0::computed: 3.00000 expected: 3.00000 difference: 0.00000
 DEAL:0::mean:
-DEAL:0::computed: -2.91750 expected: -2.91667 difference: 0.000833333
+DEAL:0::computed: -2.91688 expected: -2.91667 difference: 0.000208333
 DEAL:0::Lp_norm:
-DEAL:0::computed: 1.80970 expected: 1.80849 difference: 0.00121796
+DEAL:0::computed: 1.80879 expected: 1.80849 difference: 0.000304641
 DEAL:0::W1p_seminorm:
-DEAL:0::computed: 2.31644 expected: 2.31560 difference: 0.000840093
+DEAL:0::computed: 2.31582 expected: 2.31560 difference: 0.000216381
 DEAL:0::OK
index 630918c014ccd20799a754ca659a43a47c37249f..0039dfb2b872bf2c9dbf090b0abc292b2aaf38de 100644 (file)
@@ -1,62 +1,62 @@
 
 DEAL:0::Hdiv_seminorm:
-DEAL:0::computed: 3.05532 expected: 3.05505 difference: 0.000272760
+DEAL:0::computed: 3.05512 expected: 3.05505 difference: 6.81923e-05
 DEAL:0::L2_norm:
-DEAL:0::computed: 1.95470 expected: 1.95363 difference: 0.00106613
+DEAL:0::computed: 1.95390 expected: 1.95363 difference: 0.000266581
 DEAL:0::H1_seminorm:
-DEAL:0::computed: 2.70878 expected: 2.70801 difference: 0.000769213
+DEAL:0::computed: 2.70821 expected: 2.70801 difference: 0.000192324
 DEAL:0::H1_norm:
-DEAL:0::computed: 3.34041 expected: 3.33916 difference: 0.00124760
+DEAL:0::computed: 3.33947 expected: 3.33916 difference: 0.000311941
 DEAL:0::L1_norm:
-DEAL:0::computed: 2.91750 expected: 2.91667 difference: 0.000833333
+DEAL:0::computed: 2.91688 expected: 2.91667 difference: 0.000208333
 DEAL:0::Linfty_norm:
 DEAL:0::computed: 3.00000 expected: 3.00000 difference: 0.00000
 DEAL:0::mean:
-DEAL:0::computed: -2.91750 expected: -2.91667 difference: 0.000833333
+DEAL:0::computed: -2.91688 expected: -2.91667 difference: 0.000208333
 DEAL:0::Lp_norm:
-DEAL:0::computed: 1.80970 expected: 1.80849 difference: 0.00121796
+DEAL:0::computed: 1.80879 expected: 1.80849 difference: 0.000304641
 DEAL:0::W1p_seminorm:
-DEAL:0::computed: 2.31644 expected: 2.31560 difference: 0.000840093
+DEAL:0::computed: 2.31582 expected: 2.31560 difference: 0.000216381
 DEAL:0::OK
 
 DEAL:1::Hdiv_seminorm:
-DEAL:1::computed: 3.05532 expected: 3.05505 difference: 0.000272760
+DEAL:1::computed: 3.05512 expected: 3.05505 difference: 6.81923e-05
 DEAL:1::L2_norm:
-DEAL:1::computed: 1.95470 expected: 1.95363 difference: 0.00106613
+DEAL:1::computed: 1.95390 expected: 1.95363 difference: 0.000266581
 DEAL:1::H1_seminorm:
-DEAL:1::computed: 2.70878 expected: 2.70801 difference: 0.000769213
+DEAL:1::computed: 2.70821 expected: 2.70801 difference: 0.000192324
 DEAL:1::H1_norm:
-DEAL:1::computed: 3.34041 expected: 3.33916 difference: 0.00124760
+DEAL:1::computed: 3.33947 expected: 3.33916 difference: 0.000311941
 DEAL:1::L1_norm:
-DEAL:1::computed: 2.91750 expected: 2.91667 difference: 0.000833333
+DEAL:1::computed: 2.91688 expected: 2.91667 difference: 0.000208333
 DEAL:1::Linfty_norm:
 DEAL:1::computed: 3.00000 expected: 3.00000 difference: 0.00000
 DEAL:1::mean:
-DEAL:1::computed: -2.91750 expected: -2.91667 difference: 0.000833333
+DEAL:1::computed: -2.91688 expected: -2.91667 difference: 0.000208333
 DEAL:1::Lp_norm:
-DEAL:1::computed: 1.80970 expected: 1.80849 difference: 0.00121796
+DEAL:1::computed: 1.80879 expected: 1.80849 difference: 0.000304641
 DEAL:1::W1p_seminorm:
-DEAL:1::computed: 2.31644 expected: 2.31560 difference: 0.000840093
+DEAL:1::computed: 2.31582 expected: 2.31560 difference: 0.000216381
 DEAL:1::OK
 
 
 DEAL:2::Hdiv_seminorm:
-DEAL:2::computed: 3.05532 expected: 3.05505 difference: 0.000272760
+DEAL:2::computed: 3.05512 expected: 3.05505 difference: 6.81923e-05
 DEAL:2::L2_norm:
-DEAL:2::computed: 1.95470 expected: 1.95363 difference: 0.00106613
+DEAL:2::computed: 1.95390 expected: 1.95363 difference: 0.000266581
 DEAL:2::H1_seminorm:
-DEAL:2::computed: 2.70878 expected: 2.70801 difference: 0.000769213
+DEAL:2::computed: 2.70821 expected: 2.70801 difference: 0.000192324
 DEAL:2::H1_norm:
-DEAL:2::computed: 3.34041 expected: 3.33916 difference: 0.00124760
+DEAL:2::computed: 3.33947 expected: 3.33916 difference: 0.000311941
 DEAL:2::L1_norm:
-DEAL:2::computed: 2.91750 expected: 2.91667 difference: 0.000833333
+DEAL:2::computed: 2.91688 expected: 2.91667 difference: 0.000208333
 DEAL:2::Linfty_norm:
 DEAL:2::computed: 3.00000 expected: 3.00000 difference: 0.00000
 DEAL:2::mean:
-DEAL:2::computed: -2.91750 expected: -2.91667 difference: 0.000833333
+DEAL:2::computed: -2.91688 expected: -2.91667 difference: 0.000208333
 DEAL:2::Lp_norm:
-DEAL:2::computed: 1.80970 expected: 1.80849 difference: 0.00121796
+DEAL:2::computed: 1.80879 expected: 1.80849 difference: 0.000304641
 DEAL:2::W1p_seminorm:
-DEAL:2::computed: 2.31644 expected: 2.31560 difference: 0.000840093
+DEAL:2::computed: 2.31582 expected: 2.31560 difference: 0.000216381
 DEAL:2::OK
 
index 4ae2b2e72aa00af0330b81e7af7b19d8a67e31c5..a27c7d2b2eb41c2d77c0a58d3e38e0134c1142ba 100644 (file)
@@ -64,7 +64,7 @@ void test(VectorTools::NormType norm, double value, double exp = 2.0)
 {
   parallel::shared::Triangulation<dim> tria(MPI_COMM_WORLD);
   GridGenerator::hyper_cube(tria);
-  tria.refine_global(2);
+  tria.refine_global(3);
 
   FESystem<dim> fe(FE_Q<dim>(4),dim);
   DoFHandler<dim> dofh(tria);
index d8f0ac1c2a79c8e6e8196a8b85d3de3672009ca6..d207d6bd5048764072b9eff191c63cdf61d042be 100644 (file)
@@ -1,20 +1,20 @@
 
 DEAL:0::Hdiv_seminorm:
-DEAL:0::computed: 3.05532 expected: 3.05505 difference: 0.000272760
+DEAL:0::computed: 3.05512 expected: 3.05505 difference: 6.81923e-05
 DEAL:0::L2_norm:
-DEAL:0::computed: 1.95470 expected: 1.95363 difference: 0.00106613
+DEAL:0::computed: 1.95390 expected: 1.95363 difference: 0.000266581
 DEAL:0::H1_seminorm:
-DEAL:0::computed: 2.70878 expected: 2.70801 difference: 0.000769213
+DEAL:0::computed: 2.70821 expected: 2.70801 difference: 0.000192324
 DEAL:0::H1_norm:
-DEAL:0::computed: 3.34041 expected: 3.33916 difference: 0.00124760
+DEAL:0::computed: 3.33947 expected: 3.33916 difference: 0.000311941
 DEAL:0::L1_norm:
-DEAL:0::computed: 2.91750 expected: 2.91667 difference: 0.000833333
+DEAL:0::computed: 2.91688 expected: 2.91667 difference: 0.000208333
 DEAL:0::Linfty_norm:
 DEAL:0::computed: 3.00000 expected: 3.00000 difference: 0.00000
 DEAL:0::mean:
-DEAL:0::computed: -2.91750 expected: -2.91667 difference: 0.000833333
+DEAL:0::computed: -2.91688 expected: -2.91667 difference: 0.000208333
 DEAL:0::Lp_norm:
-DEAL:0::computed: 1.80970 expected: 1.80849 difference: 0.00121796
+DEAL:0::computed: 1.80879 expected: 1.80849 difference: 0.000304641
 DEAL:0::W1p_seminorm:
-DEAL:0::computed: 2.31644 expected: 2.31560 difference: 0.000840093
+DEAL:0::computed: 2.31582 expected: 2.31560 difference: 0.000216381
 DEAL:0::OK
index 630918c014ccd20799a754ca659a43a47c37249f..0039dfb2b872bf2c9dbf090b0abc292b2aaf38de 100644 (file)
@@ -1,62 +1,62 @@
 
 DEAL:0::Hdiv_seminorm:
-DEAL:0::computed: 3.05532 expected: 3.05505 difference: 0.000272760
+DEAL:0::computed: 3.05512 expected: 3.05505 difference: 6.81923e-05
 DEAL:0::L2_norm:
-DEAL:0::computed: 1.95470 expected: 1.95363 difference: 0.00106613
+DEAL:0::computed: 1.95390 expected: 1.95363 difference: 0.000266581
 DEAL:0::H1_seminorm:
-DEAL:0::computed: 2.70878 expected: 2.70801 difference: 0.000769213
+DEAL:0::computed: 2.70821 expected: 2.70801 difference: 0.000192324
 DEAL:0::H1_norm:
-DEAL:0::computed: 3.34041 expected: 3.33916 difference: 0.00124760
+DEAL:0::computed: 3.33947 expected: 3.33916 difference: 0.000311941
 DEAL:0::L1_norm:
-DEAL:0::computed: 2.91750 expected: 2.91667 difference: 0.000833333
+DEAL:0::computed: 2.91688 expected: 2.91667 difference: 0.000208333
 DEAL:0::Linfty_norm:
 DEAL:0::computed: 3.00000 expected: 3.00000 difference: 0.00000
 DEAL:0::mean:
-DEAL:0::computed: -2.91750 expected: -2.91667 difference: 0.000833333
+DEAL:0::computed: -2.91688 expected: -2.91667 difference: 0.000208333
 DEAL:0::Lp_norm:
-DEAL:0::computed: 1.80970 expected: 1.80849 difference: 0.00121796
+DEAL:0::computed: 1.80879 expected: 1.80849 difference: 0.000304641
 DEAL:0::W1p_seminorm:
-DEAL:0::computed: 2.31644 expected: 2.31560 difference: 0.000840093
+DEAL:0::computed: 2.31582 expected: 2.31560 difference: 0.000216381
 DEAL:0::OK
 
 DEAL:1::Hdiv_seminorm:
-DEAL:1::computed: 3.05532 expected: 3.05505 difference: 0.000272760
+DEAL:1::computed: 3.05512 expected: 3.05505 difference: 6.81923e-05
 DEAL:1::L2_norm:
-DEAL:1::computed: 1.95470 expected: 1.95363 difference: 0.00106613
+DEAL:1::computed: 1.95390 expected: 1.95363 difference: 0.000266581
 DEAL:1::H1_seminorm:
-DEAL:1::computed: 2.70878 expected: 2.70801 difference: 0.000769213
+DEAL:1::computed: 2.70821 expected: 2.70801 difference: 0.000192324
 DEAL:1::H1_norm:
-DEAL:1::computed: 3.34041 expected: 3.33916 difference: 0.00124760
+DEAL:1::computed: 3.33947 expected: 3.33916 difference: 0.000311941
 DEAL:1::L1_norm:
-DEAL:1::computed: 2.91750 expected: 2.91667 difference: 0.000833333
+DEAL:1::computed: 2.91688 expected: 2.91667 difference: 0.000208333
 DEAL:1::Linfty_norm:
 DEAL:1::computed: 3.00000 expected: 3.00000 difference: 0.00000
 DEAL:1::mean:
-DEAL:1::computed: -2.91750 expected: -2.91667 difference: 0.000833333
+DEAL:1::computed: -2.91688 expected: -2.91667 difference: 0.000208333
 DEAL:1::Lp_norm:
-DEAL:1::computed: 1.80970 expected: 1.80849 difference: 0.00121796
+DEAL:1::computed: 1.80879 expected: 1.80849 difference: 0.000304641
 DEAL:1::W1p_seminorm:
-DEAL:1::computed: 2.31644 expected: 2.31560 difference: 0.000840093
+DEAL:1::computed: 2.31582 expected: 2.31560 difference: 0.000216381
 DEAL:1::OK
 
 
 DEAL:2::Hdiv_seminorm:
-DEAL:2::computed: 3.05532 expected: 3.05505 difference: 0.000272760
+DEAL:2::computed: 3.05512 expected: 3.05505 difference: 6.81923e-05
 DEAL:2::L2_norm:
-DEAL:2::computed: 1.95470 expected: 1.95363 difference: 0.00106613
+DEAL:2::computed: 1.95390 expected: 1.95363 difference: 0.000266581
 DEAL:2::H1_seminorm:
-DEAL:2::computed: 2.70878 expected: 2.70801 difference: 0.000769213
+DEAL:2::computed: 2.70821 expected: 2.70801 difference: 0.000192324
 DEAL:2::H1_norm:
-DEAL:2::computed: 3.34041 expected: 3.33916 difference: 0.00124760
+DEAL:2::computed: 3.33947 expected: 3.33916 difference: 0.000311941
 DEAL:2::L1_norm:
-DEAL:2::computed: 2.91750 expected: 2.91667 difference: 0.000833333
+DEAL:2::computed: 2.91688 expected: 2.91667 difference: 0.000208333
 DEAL:2::Linfty_norm:
 DEAL:2::computed: 3.00000 expected: 3.00000 difference: 0.00000
 DEAL:2::mean:
-DEAL:2::computed: -2.91750 expected: -2.91667 difference: 0.000833333
+DEAL:2::computed: -2.91688 expected: -2.91667 difference: 0.000208333
 DEAL:2::Lp_norm:
-DEAL:2::computed: 1.80970 expected: 1.80849 difference: 0.00121796
+DEAL:2::computed: 1.80879 expected: 1.80849 difference: 0.000304641
 DEAL:2::W1p_seminorm:
-DEAL:2::computed: 2.31644 expected: 2.31560 difference: 0.000840093
+DEAL:2::computed: 2.31582 expected: 2.31560 difference: 0.000216381
 DEAL:2::OK
 

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.