]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
add simpler assertion for one of the most common cases
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 9 Sep 2007 23:59:12 +0000 (23:59 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 9 Sep 2007 23:59:12 +0000 (23:59 +0000)
git-svn-id: https://svn.dealii.org/trunk@15181 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/exceptions.h

index a2c774636c6809fb8e9af4cb0dc035ccc066aac7..99ef2988be2fa19f6d44f27bdf7a83dfac33177f 100644 (file)
@@ -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.

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.