From 5f2efc980829416ccf410b648a8663604eff3981 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Sun, 9 Sep 2007 23:59:12 +0000 Subject: [PATCH] add simpler assertion for one of the most common cases git-svn-id: https://svn.dealii.org/trunk@15181 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/exceptions.h | 11 +++++++++++ 1 file changed, 11 insertions(+) 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. -- 2.39.5