From: Martin Kronbichler Date: Thu, 12 Apr 2018 19:03:39 +0000 (+0200) Subject: Slightly relax condition for even-odd tensor product value path. X-Git-Tag: v9.0.0-rc1~163^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67cd7461792fd53b0c7612c68c2b0e150babc847;p=dealii.git Slightly relax condition for even-odd tensor product value path. --- diff --git a/include/deal.II/matrix_free/shape_info.templates.h b/include/deal.II/matrix_free/shape_info.templates.h index 8260f8f869..a47d16ab69 100644 --- a/include/deal.II/matrix_free/shape_info.templates.h +++ b/include/deal.II/matrix_free/shape_info.templates.h @@ -390,16 +390,13 @@ namespace internal return false; // shape values should be zero at x=0.5 for all basis functions except - // for one which is one + // for the middle one if (n_q_points_1d%2 == 1 && n_dofs_1d%2 == 1) { for (unsigned int i=0; i zero_tol) return false; - if (std::abs(get_first_array_element(shape_values[(n_dofs_1d/2)*n_q_points_1d+ - n_q_points_1d/2])-1.)> zero_tol) - return false; } // skew-symmetry for gradient, zero of middle basis function in middle diff --git a/include/deal.II/matrix_free/tensor_product_kernels.h b/include/deal.II/matrix_free/tensor_product_kernels.h index 62dc19dc51..1056bbf0dc 100644 --- a/include/deal.II/matrix_free/tensor_product_kernels.h +++ b/include/deal.II/matrix_free/tensor_product_kernels.h @@ -1621,9 +1621,9 @@ namespace internal if ( type == 0 && contract_over_rows == true && nn%2==1 && mm%2==1 ) { if (add==false) - out[stride*n_cols] = xmid; + out[stride*n_cols] = shapes[mid*offset+n_cols] * xmid; else - out[stride*n_cols] += xmid; + out[stride*n_cols] += shapes[mid*offset+n_cols] * xmid; } else if (contract_over_rows == true && nn%2==1) { @@ -1665,9 +1665,7 @@ namespace internal else r0 = Number(); - if (type == 0 && mm % 2 == 1) - r0 += xmid; - else if (type == 2 && mm % 2 == 1) + if ((type == 0 || type == 2) && mm % 2 == 1) r0 += shapes[n_cols*offset+mid] * xmid; if (add == false) diff --git a/tests/matrix_free/evaluate_1d_shape_02.cc b/tests/matrix_free/evaluate_1d_shape_02.cc index d0c5e11eee..4f74c0c4ed 100644 --- a/tests/matrix_free/evaluate_1d_shape_02.cc +++ b/tests/matrix_free/evaluate_1d_shape_02.cc @@ -42,7 +42,7 @@ void test() { for (unsigned int i=0; i