]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add AssertIndexRange for FEPointEvaluation 12388/head
authorJudith Pauen <Judith.Pauen@gmx.net>
Fri, 4 Jun 2021 15:03:51 +0000 (17:03 +0200)
committerJudith Pauen <judith.pauen@gmx.net>
Mon, 7 Jun 2021 12:11:40 +0000 (14:11 +0200)
doc/news/changes/minor/20210605Pauen [new file with mode: 0644]
include/deal.II/matrix_free/fe_point_evaluation.h

diff --git a/doc/news/changes/minor/20210605Pauen b/doc/news/changes/minor/20210605Pauen
new file mode 100644 (file)
index 0000000..62252c8
--- /dev/null
@@ -0,0 +1,4 @@
+Improved: An assert has been added in the constructor of
+FEPointEvaluation to prevent accessing non-existing components.
+<br>
+(Judith Pauen, 2021/06/05)
index 8acf9d16c20f4a768cecbbfa451386be8ca7fd12..f059e9b097e61a867c28a8c994c17b4495cf6f14 100644 (file)
@@ -691,6 +691,9 @@ FEPointEvaluation<n_components, dim, spacedim, Number>::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;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.