From 651f2699be6d0eac87c362ffc3a62fe33c1ae37d Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Thu, 26 Nov 2020 11:01:37 +0100 Subject: [PATCH] MatrixFree: consider reference-cell type within reorder_face_derivative_indices() --- .../matrix_free/mapping_info.templates.h | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/include/deal.II/matrix_free/mapping_info.templates.h b/include/deal.II/matrix_free/mapping_info.templates.h index 2a669655d5..8d6d6aa166 100644 --- a/include/deal.II/matrix_free/mapping_info.templates.h +++ b/include/deal.II/matrix_free/mapping_info.templates.h @@ -1725,10 +1725,24 @@ namespace internal // indices of the Jacobian appropriately. template unsigned int - reorder_face_derivative_indices(const unsigned int face_no, - const unsigned int index) + reorder_face_derivative_indices( + const unsigned int face_no, + const unsigned int index, + const ReferenceCell::Type reference_cell_type = + ReferenceCell::Type::Invalid) { Assert(index < dim, ExcInternalError()); + + if ((reference_cell_type == ReferenceCell::Type::Invalid || + reference_cell_type == ReferenceCell::get_hypercube(dim)) == false) + { +#ifdef DEAL_II_WITH_SIMPLEX_SUPPORT + return index; +#else + Assert(false, ExcNotImplemented()); +#endif + } + if (dim == 3) { unsigned int table[3][3] = {{1, 2, 0}, {2, 0, 1}, {0, 1, 2}}; @@ -1890,7 +1904,9 @@ namespace internal JxW_is_similar = false; const unsigned int ee = reorder_face_derivative_indices( - faces[face].interior_face_no, e); + faces[face].interior_face_no, + e, + cell_it->reference_cell_type()); face_data.general_jac[q][d][e][v] = inv_jac[d][ee]; } @@ -2001,7 +2017,9 @@ namespace internal JxW_is_similar = false; const unsigned int ee = reorder_face_derivative_indices( - faces[face].exterior_face_no, e); + faces[face].exterior_face_no, + e, + cell_it->reference_cell_type()); face_data.general_jac[n_q_points + q][d][e][v] = inv_jac[d][ee]; } -- 2.39.5