From c49940a4ea6eb37faaf52cb91fa3f80741f788eb Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Sat, 18 Sep 2021 21:58:18 +0200 Subject: [PATCH] Do not build inner face data if not requested --- include/deal.II/matrix_free/face_setup_internal.h | 4 ++++ include/deal.II/matrix_free/matrix_free.templates.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/include/deal.II/matrix_free/face_setup_internal.h b/include/deal.II/matrix_free/face_setup_internal.h index 504bd6dc63..5499c18300 100644 --- a/include/deal.II/matrix_free/face_setup_internal.h +++ b/include/deal.II/matrix_free/face_setup_internal.h @@ -82,6 +82,7 @@ namespace internal const dealii::Triangulation &triangulation, const unsigned int mg_level, const bool hold_all_faces_to_owned_cells, + const bool build_inner_faces, std::vector> &cell_levels); /** @@ -165,6 +166,7 @@ namespace internal const dealii::Triangulation &triangulation, const unsigned int mg_level, const bool hold_all_faces_to_owned_cells, + const bool build_inner_faces, std::vector> &cell_levels) { use_active_cells = mg_level == numbers::invalid_unsigned_int; @@ -583,6 +585,8 @@ namespace internal if (dcell->at_boundary(f) && !dcell->has_periodic_neighbor(f)) face_is_owned[dcell->face(f)->index()] = FaceCategory::locally_active_at_boundary; + else if (!build_inner_faces) + continue; // treat boundaries of cells of different refinement level // inside the domain in case of multigrid separately diff --git a/include/deal.II/matrix_free/matrix_free.templates.h b/include/deal.II/matrix_free/matrix_free.templates.h index 053eef26ca..4f7666d93e 100644 --- a/include/deal.II/matrix_free/matrix_free.templates.h +++ b/include/deal.II/matrix_free/matrix_free.templates.h @@ -1029,6 +1029,7 @@ namespace internal const std::vector &cell_vectorization_category, const bool cell_vectorization_categories_strict, const bool do_face_integrals, + const bool build_inner_faces, const bool overlap_communication_computation, MatrixFreeFunctions::TaskInfo & task_info, std::vector> &cell_level_index, @@ -1041,6 +1042,7 @@ namespace internal face_setup.initialize(dof_handler[0]->get_triangulation(), mg_level, hold_all_faces_to_owned_cells, + build_inner_faces, cell_level_index); const unsigned int n_dof_handlers = dof_handler.size(); @@ -1740,6 +1742,7 @@ MatrixFree::initialize_indices( additional_data.cell_vectorization_category, additional_data.cell_vectorization_categories_strict, do_face_integrals, + additional_data.mapping_update_flags_inner_faces != update_default, additional_data.overlap_communication_computation, task_info, cell_level_index, -- 2.39.5