From 3d21248c60963974ca546bcb9d0b02839c3dfd59 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Mon, 19 Jun 2023 19:06:05 +0200 Subject: [PATCH] MatrixFree: Only set up the inner faces when so requested --- .../changes/incompatibilities/20230619Kronbichler | 9 +++++++++ include/deal.II/matrix_free/matrix_free.templates.h | 13 +++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 doc/news/changes/incompatibilities/20230619Kronbichler diff --git a/doc/news/changes/incompatibilities/20230619Kronbichler b/doc/news/changes/incompatibilities/20230619Kronbichler new file mode 100644 index 0000000000..57a57cdba5 --- /dev/null +++ b/doc/news/changes/incompatibilities/20230619Kronbichler @@ -0,0 +1,9 @@ +MatrixFree::reinit() would always set up the data structures for inner faces, +also in case only +MatrixFree::AdditionalData::mapping_updates_flags_boundary_faces was set. As +this can lead to considerably higher memory consumption, the inner faces are +now only set up when requested, increasing efficiency. When inner faces are +desired, make sure to set +MatrixFree::AdditionalData::mapping_updates_flags_inner_faces. +
+(Martin Kronbichler, 2023/06/19) diff --git a/include/deal.II/matrix_free/matrix_free.templates.h b/include/deal.II/matrix_free/matrix_free.templates.h index 4f66144506..7b458add7b 100644 --- a/include/deal.II/matrix_free/matrix_free.templates.h +++ b/include/deal.II/matrix_free/matrix_free.templates.h @@ -1969,12 +1969,13 @@ MatrixFree::initialize_indices( true); } - internal::MatrixFreeFunctions::collect_faces_vectorization( - face_setup.inner_faces, - hard_vectorization_boundary, - task_info.face_partition_data, - face_info.faces, - dof_info[0].cell_active_fe_index); + if (additional_data.mapping_update_flags_inner_faces != update_default) + internal::MatrixFreeFunctions::collect_faces_vectorization( + face_setup.inner_faces, + hard_vectorization_boundary, + task_info.face_partition_data, + face_info.faces, + dof_info[0].cell_active_fe_index); // on boundary faces, we must also respect the vectorization boundary of // the inner faces because we might have dependencies on ghosts of -- 2.39.5