From ca485850c79eb162727ab2002abf20f7318de8f1 Mon Sep 17 00:00:00 2001 From: Bruno Turcksin Date: Wed, 14 Sep 2022 19:37:10 +0000 Subject: [PATCH] Improve support to FE_Nothing in matrix-free hanging_nodes --- include/deal.II/matrix_free/hanging_nodes_internal.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/deal.II/matrix_free/hanging_nodes_internal.h b/include/deal.II/matrix_free/hanging_nodes_internal.h index 86312effc9..ba20ae6f3c 100644 --- a/include/deal.II/matrix_free/hanging_nodes_internal.h +++ b/include/deal.II/matrix_free/hanging_nodes_internal.h @@ -529,6 +529,10 @@ namespace internal neighbor->level() == cell->level()) continue; + // Ignore if the neighbors are FE_Nothing + if (neighbor->get_fe().n_dofs_per_cell() == 0) + continue; + face |= 1 << direction; } @@ -549,10 +553,16 @@ namespace internal std::find_if(line_to_cells[line_index].begin(), line_to_cells[line_index].end(), [&cell](const auto &edge_neighbor) { + DoFCellAccessor dof_cell( + &edge_neighbor.first->get_triangulation(), + edge_neighbor.first->level(), + edge_neighbor.first->index(), + &cell->get_dof_handler()); return edge_neighbor.first->is_artificial() == false && edge_neighbor.first->level() < - cell->level(); + cell->level() && + dof_cell.get_fe().n_dofs_per_cell() > 0; }); if (edge_neighbor == line_to_cells[line_index].end()) -- 2.39.5