From: Judith Pauen Date: Fri, 4 Jun 2021 15:03:51 +0000 (+0200) Subject: Add AssertIndexRange for FEPointEvaluation X-Git-Tag: v9.4.0-rc1~1270^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f501ddeedf8f4c0a51f7f3cc987a6f2b78d7757b;p=dealii.git Add AssertIndexRange for FEPointEvaluation --- 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;