From a736df07ffd640af7d3c7ef48a2f5fd9e5e39532 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Wed, 25 May 2016 15:55:02 +0100 Subject: [PATCH] fix compute_global_error() - Fix parallel loop over cells in compute_global_error. - Change tests to trigger bug that is now fixed. --- .../deal.II/numerics/vector_tools.templates.h | 4 +- tests/mpi/integrate_difference.cc | 2 +- tests/vector_tools/integrate_difference_03.cc | 2 +- ...linos=true.with_p4est=true.mpirun=1.output | 16 +++---- ...ilinos=true.with_p4est=truempirun=3.output | 48 +++++++++---------- tests/vector_tools/integrate_difference_04.cc | 2 +- ...linos=true.with_metis=true.mpirun=1.output | 16 +++---- ...linos=true.with_metis=true.mpirun=3.output | 48 +++++++++---------- 8 files changed, 69 insertions(+), 69 deletions(-) diff --git a/include/deal.II/numerics/vector_tools.templates.h b/include/deal.II/numerics/vector_tools.templates.h index 3bc45d8325..f5c046b61c 100644 --- a/include/deal.II/numerics/vector_tools.templates.h +++ b/include/deal.II/numerics/vector_tools.templates.h @@ -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::cell_iterator it = tria.begin_active(); + typename Triangulation::active_cell_iterator it = tria.begin_active(); for (; iis_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::cell_iterator it = tria.begin_active(); + typename Triangulation::active_cell_iterator it = tria.begin_active(); for (i = 0; iis_locally_owned()) local += std::pow(cellwise_error[i], exponent); diff --git a/tests/mpi/integrate_difference.cc b/tests/mpi/integrate_difference.cc index cc9bf9d7d4..233373c8fc 100644 --- a/tests/mpi/integrate_difference.cc +++ b/tests/mpi/integrate_difference.cc @@ -59,7 +59,7 @@ void test() parallel::distributed::Triangulation tr(MPI_COMM_WORLD); GridGenerator::hyper_cube(tr); - tr.refine_global (2); + tr.refine_global (3); const FE_Q fe(2); DoFHandler dofh(tr); diff --git a/tests/vector_tools/integrate_difference_03.cc b/tests/vector_tools/integrate_difference_03.cc index 40a7673539..731c9ffa92 100644 --- a/tests/vector_tools/integrate_difference_03.cc +++ b/tests/vector_tools/integrate_difference_03.cc @@ -64,7 +64,7 @@ void test(VectorTools::NormType norm, double value, double exp = 2.0) { parallel::distributed::Triangulation tria(MPI_COMM_WORLD); GridGenerator::hyper_cube(tria); - tria.refine_global(2); + tria.refine_global(3); FESystem fe(FE_Q(4),dim); DoFHandler dofh(tria); diff --git a/tests/vector_tools/integrate_difference_03.with_trilinos=true.with_p4est=true.mpirun=1.output b/tests/vector_tools/integrate_difference_03.with_trilinos=true.with_p4est=true.mpirun=1.output index d8f0ac1c2a..d207d6bd50 100644 --- a/tests/vector_tools/integrate_difference_03.with_trilinos=true.with_p4est=true.mpirun=1.output +++ b/tests/vector_tools/integrate_difference_03.with_trilinos=true.with_p4est=true.mpirun=1.output @@ -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 diff --git a/tests/vector_tools/integrate_difference_03.with_trilinos=true.with_p4est=truempirun=3.output b/tests/vector_tools/integrate_difference_03.with_trilinos=true.with_p4est=truempirun=3.output index 630918c014..0039dfb2b8 100644 --- a/tests/vector_tools/integrate_difference_03.with_trilinos=true.with_p4est=truempirun=3.output +++ b/tests/vector_tools/integrate_difference_03.with_trilinos=true.with_p4est=truempirun=3.output @@ -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 diff --git a/tests/vector_tools/integrate_difference_04.cc b/tests/vector_tools/integrate_difference_04.cc index 4ae2b2e72a..a27c7d2b2e 100644 --- a/tests/vector_tools/integrate_difference_04.cc +++ b/tests/vector_tools/integrate_difference_04.cc @@ -64,7 +64,7 @@ void test(VectorTools::NormType norm, double value, double exp = 2.0) { parallel::shared::Triangulation tria(MPI_COMM_WORLD); GridGenerator::hyper_cube(tria); - tria.refine_global(2); + tria.refine_global(3); FESystem fe(FE_Q(4),dim); DoFHandler dofh(tria); diff --git a/tests/vector_tools/integrate_difference_04.with_trilinos=true.with_metis=true.mpirun=1.output b/tests/vector_tools/integrate_difference_04.with_trilinos=true.with_metis=true.mpirun=1.output index d8f0ac1c2a..d207d6bd50 100644 --- a/tests/vector_tools/integrate_difference_04.with_trilinos=true.with_metis=true.mpirun=1.output +++ b/tests/vector_tools/integrate_difference_04.with_trilinos=true.with_metis=true.mpirun=1.output @@ -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 diff --git a/tests/vector_tools/integrate_difference_04.with_trilinos=true.with_metis=true.mpirun=3.output b/tests/vector_tools/integrate_difference_04.with_trilinos=true.with_metis=true.mpirun=3.output index 630918c014..0039dfb2b8 100644 --- a/tests/vector_tools/integrate_difference_04.with_trilinos=true.with_metis=true.mpirun=3.output +++ b/tests/vector_tools/integrate_difference_04.with_trilinos=true.with_metis=true.mpirun=3.output @@ -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 -- 2.39.5