From: kanschat Date: Sun, 9 Sep 2007 23:59:12 +0000 (+0000) Subject: add simpler assertion for one of the most common cases X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5269ec37e0b86e5a3221016de9ae2e86166568da;p=dealii-svn.git add simpler assertion for one of the most common cases git-svn-id: https://svn.dealii.org/trunk@15181 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/exceptions.h b/deal.II/base/include/base/exceptions.h index a2c774636c..99ef2988be 100644 --- a/deal.II/base/include/base/exceptions.h +++ b/deal.II/base/include/base/exceptions.h @@ -909,6 +909,17 @@ namespace StandardExceptions //@} } +/** + * Special assertion for dimension mismatch. + * + * Since this is used very often and always repeats the arguments, we + *introduce this special assertion for ExcDimensionMismatch in order + *to keep the user codes shorter. + */ +#define AssertDimension(dim1,dim2) Assert((dim1) == (dim2), \ + ExcDimensionMismatch((dim1),(dim2))) + + /* * Unfortunately, the following must be repeated for each library, * since we cannot have ifdefs in macros.