From: Maximilian Bergbauer Date: Fri, 28 Apr 2023 11:28:57 +0000 (+0200) Subject: Fix bug in integrate_add_tensor_product_value_and_gradient_linear() X-Git-Tag: v9.5.0-rc1~281^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15155%2Fhead;p=dealii.git Fix bug in integrate_add_tensor_product_value_and_gradient_linear() --- diff --git a/include/deal.II/matrix_free/tensor_product_kernels.h b/include/deal.II/matrix_free/tensor_product_kernels.h index 1c13afb9bf..29af641639 100644 --- a/include/deal.II/matrix_free/tensor_product_kernels.h +++ b/include/deal.II/matrix_free/tensor_product_kernels.h @@ -3613,8 +3613,8 @@ namespace internal { const auto x0 = 1. - p[0], x1 = p[0]; - values[0] = value * x0 - gradient[0]; - values[1] = value * x1 + gradient[0]; + values[0] += value * x0 - gradient[0]; + values[1] += value * x1 + gradient[0]; } else if (dim == 2) { diff --git a/tests/matrix_free/point_evaluation_22.cc b/tests/matrix_free/point_evaluation_22.cc index 816e7c16ce..bf4480a202 100644 --- a/tests/matrix_free/point_evaluation_22.cc +++ b/tests/matrix_free/point_evaluation_22.cc @@ -164,6 +164,7 @@ main() initlog(); deallog << std::setprecision(10); + test<1>(1); test<1>(3); test<2>(1); test<2>(2); diff --git a/tests/matrix_free/point_evaluation_22.output b/tests/matrix_free/point_evaluation_22.output index 605e73e5c5..2cf39e2ec5 100644 --- a/tests/matrix_free/point_evaluation_22.output +++ b/tests/matrix_free/point_evaluation_22.output @@ -1,20 +1,53 @@ -DEAL::Mapping of degree 3 +DEAL::Mapping of degree 1 DEAL::Cell with center 0.2500000000 -DEAL::0.000000000: 0.000000000 error value 0.000000000 error grad 4.440892099e-16 +DEAL::0.000000000: 0.000000000 error value 0.000000000 error grad 0.000000000 DEAL::0.02941176471: 0.02941176471 error value 0.000000000 error grad 0.000000000 -DEAL::0.05882352941: 0.05882352941 error value -6.938893904e-18 error grad 2.220446049e-16 +DEAL::0.05882352941: 0.05882352941 error value 0.000000000 error grad 0.000000000 DEAL::0.08823529412: 0.08823529412 error value 0.000000000 error grad 0.000000000 -DEAL::0.1176470588: 0.1176470588 error value 1.387778781e-17 error grad 2.220446049e-16 -DEAL::0.1470588235: 0.1470588235 error value 2.775557562e-17 error grad 3.330669074e-16 +DEAL::0.1176470588: 0.1176470588 error value 0.000000000 error grad 0.000000000 +DEAL::0.1470588235: 0.1470588235 error value 0.000000000 error grad 0.000000000 DEAL::0.1764705882: 0.1764705882 error value 0.000000000 error grad 0.000000000 -DEAL::0.2058823529: 0.2058823529 error value -2.775557562e-17 error grad 1.110223025e-16 -DEAL::0.2352941176: 0.2352941176 error value 0.000000000 error grad 1.110223025e-16 -DEAL::0.2647058824: 0.2647058824 error value 0.000000000 error grad 2.220446049e-16 +DEAL::0.2058823529: 0.2058823529 error value 0.000000000 error grad 0.000000000 +DEAL::0.2352941176: 0.2352941176 error value 0.000000000 error grad 0.000000000 +DEAL::0.2647058824: 0.2647058824 error value 0.000000000 error grad 0.000000000 DEAL::0.2941176471: 0.2941176471 error value 0.000000000 error grad 0.000000000 DEAL::0.3235294118: 0.3235294118 error value 0.000000000 error grad 0.000000000 DEAL::0.3529411765: 0.3529411765 error value 0.000000000 error grad 0.000000000 DEAL:: +DEAL::-24.83044983 27.12456747 +DEAL::Cell with center 0.7500000000 +DEAL::0.5000000000: 0.5000000000 error value 0.000000000 error grad 0.000000000 +DEAL::0.5294117647: 0.5294117647 error value 0.000000000 error grad 0.000000000 +DEAL::0.5588235294: 0.5588235294 error value 0.000000000 error grad 0.000000000 +DEAL::0.5882352941: 0.5882352941 error value 0.000000000 error grad 0.000000000 +DEAL::0.6176470588: 0.6176470588 error value 0.000000000 error grad 0.000000000 +DEAL::0.6470588235: 0.6470588235 error value 0.000000000 error grad 0.000000000 +DEAL::0.6764705882: 0.6764705882 error value 0.000000000 error grad 0.000000000 +DEAL::0.7058823529: 0.7058823529 error value 0.000000000 error grad 0.000000000 +DEAL::0.7352941176: 0.7352941176 error value 0.000000000 error grad 0.000000000 +DEAL::0.7647058824: 0.7647058824 error value 0.000000000 error grad 0.000000000 +DEAL::0.7941176471: 0.7941176471 error value 0.000000000 error grad 0.000000000 +DEAL::0.8235294118: 0.8235294118 error value 0.000000000 error grad 0.000000000 +DEAL::0.8529411765: 0.8529411765 error value 0.000000000 error grad 0.000000000 +DEAL:: +DEAL::-20.62456747 29.41868512 +DEAL::Mapping of degree 3 +DEAL::Cell with center 0.2500000000 +DEAL::0.000000000: 0.000000000 error value 0.000000000 error grad 0.000000000 +DEAL::0.02941176471: 0.02941176471 error value 0.000000000 error grad 0.000000000 +DEAL::0.05882352941: 0.05882352941 error value -1.387778781e-17 error grad 0.000000000 +DEAL::0.08823529412: 0.08823529412 error value 0.000000000 error grad 2.220446049e-16 +DEAL::0.1176470588: 0.1176470588 error value 1.387778781e-17 error grad 2.220446049e-16 +DEAL::0.1470588235: 0.1470588235 error value 0.000000000 error grad 0.000000000 +DEAL::0.1764705882: 0.1764705882 error value 0.000000000 error grad 2.220446049e-16 +DEAL::0.2058823529: 0.2058823529 error value 0.000000000 error grad 2.220446049e-16 +DEAL::0.2352941176: 0.2352941176 error value 2.775557562e-17 error grad 0.000000000 +DEAL::0.2647058824: 0.2647058824 error value 0.000000000 error grad 2.220446049e-16 +DEAL::0.2941176471: 0.2941176471 error value 0.000000000 error grad 0.000000000 +DEAL::0.3235294118: 0.3235294118 error value 0.000000000 error grad 2.220446049e-16 +DEAL::0.3529411765: 0.3529411765 error value -5.551115123e-17 error grad 2.220446049e-16 +DEAL:: DEAL::-40.02339531 1.555249578 8.779994658 31.98226872 DEAL::Cell with center 0.7500000000 DEAL::0.5000000000: 0.5000000000 error value 0.000000000 error grad 5.551115123e-16