From: wolf Date: Tue, 30 Sep 2003 16:18:02 +0000 (+0000) Subject: Add some assertions. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc3242867f36d1f25db27f756d903898cb256a32;p=dealii-svn.git Add some assertions. git-svn-id: https://svn.dealii.org/trunk@8075 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/fe/mapping_q1.cc b/deal.II/deal.II/source/fe/mapping_q1.cc index ae4d183d46..4980e301fc 100644 --- a/deal.II/deal.II/source/fe/mapping_q1.cc +++ b/deal.II/deal.II/source/fe/mapping_q1.cc @@ -42,6 +42,11 @@ namespace internal const unsigned int face_no, const unsigned int n_quadrature_points) { + Assert (dim != 1, ExcInternalError()); + Assert (face_no < GeometryInfo::faces_per_cell, + ExcInternalError()); + Assert (n_quadrature_points > 0, ExcInternalError()); + switch (dim) { case 1: @@ -77,6 +82,15 @@ namespace internal const unsigned int subface_no, const unsigned int n_quadrature_points) { + Assert (dim != 1, ExcInternalError()); + Assert (face_no < GeometryInfo::faces_per_cell, + ExcInternalError()); + // the trick with +1 prevents + // that we get a warning in 1d + Assert (subface_no+1 < GeometryInfo::subfaces_per_face+1, + ExcInternalError()); + Assert (n_quadrature_points > 0, ExcInternalError()); + switch (dim) { case 1: