From f501ddeedf8f4c0a51f7f3cc987a6f2b78d7757b Mon Sep 17 00:00:00 2001 From: Judith Pauen Date: Fri, 4 Jun 2021 17:03:51 +0200 Subject: [PATCH] Add AssertIndexRange for FEPointEvaluation --- doc/news/changes/minor/20210605Pauen | 4 ++++ include/deal.II/matrix_free/fe_point_evaluation.h | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 doc/news/changes/minor/20210605Pauen diff --git a/doc/news/changes/minor/20210605Pauen b/doc/news/changes/minor/20210605Pauen new file mode 100644 index 0000000000..62252c8aa7 --- /dev/null +++ b/doc/news/changes/minor/20210605Pauen @@ -0,0 +1,4 @@ +Improved: An assert has been added in the constructor of +FEPointEvaluation to prevent accessing non-existing components. +
+(Judith Pauen, 2021/06/05) diff --git a/include/deal.II/matrix_free/fe_point_evaluation.h b/include/deal.II/matrix_free/fe_point_evaluation.h index 8acf9d16c2..f059e9b097 100644 --- a/include/deal.II/matrix_free/fe_point_evaluation.h +++ b/include/deal.II/matrix_free/fe_point_evaluation.h @@ -691,6 +691,9 @@ FEPointEvaluation::FEPointEvaluation( , update_flags(update_flags) , update_flags_mapping(update_default) { + AssertIndexRange(first_selected_component + n_components, + fe.n_components() + 1); + bool same_base_element = true; unsigned int base_element_number = 0; unsigned int component = 0; -- 2.39.5