From: Martin Kronbichler Date: Tue, 31 May 2022 11:17:00 +0000 (+0200) Subject: MatrixFree: Do not construct hanging nodes structure for non-adapted meshes X-Git-Tag: v9.4.0-rc1~91^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d58492728abc4a314408799c2abb12d1899795f0;p=dealii.git MatrixFree: Do not construct hanging nodes structure for non-adapted meshes --- diff --git a/include/deal.II/matrix_free/hanging_nodes_internal.h b/include/deal.II/matrix_free/hanging_nodes_internal.h index c946ad4339..d7bfbb3143 100644 --- a/include/deal.II/matrix_free/hanging_nodes_internal.h +++ b/include/deal.II/matrix_free/hanging_nodes_internal.h @@ -376,6 +376,17 @@ namespace internal inline void HangingNodes<3>::setup_line_to_cell(const Triangulation<3> &triangulation) { + // Check if we there are no hanging nodes on the current MPI process, + // which we do by checking if the second finest level holds no active + // non-artificial cell + if (triangulation.n_levels() <= 1 || + std::none_of(triangulation.begin_active(triangulation.n_levels() - 2), + triangulation.end_active(triangulation.n_levels() - 2), + [](const CellAccessor<3, 3> &cell) { + return !cell.is_artificial(); + })) + return; + const unsigned int n_raw_lines = triangulation.n_raw_lines(); this->line_to_cells.resize(n_raw_lines);