*/
#ifdef DEBUG
# ifdef DEAL_II_HAVE_BUILTIN_EXPECT
-# define Assert(cond, exc) \
- { \
- if (__builtin_expect(!(cond), false)) \
- ::dealii::deal_II_exceptions::internals:: \
- issue_error_noreturn( \
- ::dealii::deal_II_exceptions::internals::abort_on_exception, \
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \
- }
+# define Assert(cond, exc) \
+{ \
+ if (__builtin_expect(!(cond), false)) \
+ ::dealii::deal_II_exceptions::internals:: issue_error_noreturn( \
+ ::dealii::deal_II_exceptions::internals::abort_on_exception, \
+ __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \
+}
# else
-# define Assert(cond, exc) \
- { \
- if (!(cond)) \
- ::dealii::deal_II_exceptions::internals:: \
- issue_error_noreturn( \
- ::dealii::deal_II_exceptions::internals::abort_on_exception, \
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \
- }
+# define Assert(cond, exc) \
+{ \
+ if (!(cond)) \
+ ::dealii::deal_II_exceptions::internals:: issue_error_noreturn( \
+ ::dealii::deal_II_exceptions::internals::abort_on_exception, \
+ __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \
+}
# endif
#else
-#define Assert(cond, exc) \
+#define Assert(cond, exc) \
{}
#endif
*/
#ifdef DEBUG
# ifdef DEAL_II_HAVE_BUILTIN_EXPECT
-# define AssertNothrow(cond, exc) \
- { \
- if (__builtin_expect(!(cond), false)) \
- ::dealii::deal_II_exceptions::internals:: \
- issue_error_nothrow( \
- ::dealii::deal_II_exceptions::internals::abort_nothrow_on_exception, \
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \
- }
+# define AssertNothrow(cond, exc) \
+{ \
+ if (__builtin_expect(!(cond), false)) \
+ ::dealii::deal_II_exceptions::internals::issue_error_nothrow( \
+ ::dealii::deal_II_exceptions::internals::abort_nothrow_on_exception, \
+ __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \
+}
# else
-# define AssertNothrow(cond, exc) \
- { \
- if (!(cond)) \
- ::dealii::deal_II_exceptions::internals:: \
- issue_error_nothrow( \
- ::dealii::deal_II_exceptions::internals::abort_nothrow_on_exception, \
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \
- }
+# define AssertNothrow(cond, exc) \
+{ \
+ if (!(cond)) \
+ ::dealii::deal_II_exceptions::internals::issue_error_nothrow( \
+ ::dealii::deal_II_exceptions::internals::abort_nothrow_on_exception, \
+ __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \
+}
# endif
#else
-#define AssertNothrow(cond, exc) \
+#define AssertNothrow(cond, exc) \
{}
#endif
-
-
/**
* A macro that serves as the main routine in the exception mechanism for dynamic
* error checking. It asserts that a certain condition is fulfilled, otherwise
* @author Wolfgang Bangerth, 1997, 1998, Matthias Maier, 2013
*/
#ifdef DEAL_II_HAVE_BUILTIN_EXPECT
-#define AssertThrow(cond, exc) \
- { \
- if (__builtin_expect(!(cond), false)) \
- ::dealii::deal_II_exceptions::internals:: \
- issue_error_noreturn( \
- ::dealii::deal_II_exceptions::internals::throw_on_exception, \
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \
- }
+#define AssertThrow(cond, exc) \
+{ \
+ if (__builtin_expect(!(cond), false)) \
+ ::dealii::deal_II_exceptions::internals:: issue_error_noreturn( \
+ ::dealii::deal_II_exceptions::internals::throw_on_exception, \
+ __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \
+}
#else /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/
-#define AssertThrow(cond, exc) \
- { \
- if (!(cond)) \
- ::dealii::deal_II_exceptions::internals:: \
- issue_error_noreturn( \
- ::dealii::deal_II_exceptions::internals::throw_on_exception, \
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \
- }
+#define AssertThrow(cond, exc) \
+{ \
+ if (!(cond)) \
+ ::dealii::deal_II_exceptions::internals::issue_error_noreturn( \
+ ::dealii::deal_II_exceptions::internals::throw_on_exception, \
+ __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \
+}
#endif /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/
#endif // DEAL_II_WITH_MPI
} /*namespace StandardExceptions*/
-
/**
* Special assertion for dimension mismatch.
*
* @ingroup Exceptions
* @author Guido Kanschat 2007
*/
-#define AssertDimension(dim1,dim2) Assert((dim1) == (dim2), \
- dealii::ExcDimensionMismatch((dim1),(dim2)))
+#define AssertDimension(dim1,dim2) \
+Assert((dim1) == (dim2), dealii::ExcDimensionMismatch((dim1),(dim2)))
/**
* @ingroup Exceptions
* @author Guido Kanschat 2010
*/
-#define AssertVectorVectorDimension(vec,dim1,dim2) AssertDimension((vec).size(), (dim1)) \
- for (unsigned int i=0;i<dim1;++i) { AssertDimension((vec)[i].size(), (dim2)); }
+#define AssertVectorVectorDimension(vec,dim1,dim2) \
+AssertDimension((vec).size(), (dim1)); \
+for (unsigned int i=0;i<dim1;++i) {AssertDimension((vec)[i].size(), (dim2));} \
namespace internal
{
* @ingroup Exceptions
* @author Guido Kanschat 2007
*/
-#define AssertIndexRange(index,range) \
- Assert((index) < (range), \
- dealii::ExcIndexRangeType< \
- typename ::dealii::internal::argument_type< \
- void(typename std::common_type<decltype(index), \
- decltype(range)>::type)>::type>((index),0,(range)))
+#define AssertIndexRange(index,range) \
+Assert((index) < (range), \
+dealii::ExcIndexRangeType<typename ::dealii::internal::argument_type< \
+void(typename std::common_type<decltype(index), \
+ decltype(range)>::type)>::type>((index),0,(range)))
/**
* An assertion that checks whether a number is finite or not. We explicitly
* @ingroup Exceptions
* @author Wolfgang Bangerth, 2015
*/
-#define AssertIsFinite(number) Assert(dealii::numbers::is_finite(number), \
- dealii::ExcNumberNotFinite(std::complex<double>(number)))
+#define AssertIsFinite(number) \
+Assert(dealii::numbers::is_finite(number), \
+dealii::ExcNumberNotFinite(std::complex<double>(number)))
#ifdef DEAL_II_WITH_MPI
/**
* @ingroup Exceptions
* @author David Wells, 2016
*/
-#define AssertThrowMPI(error_code) AssertThrow(error_code == MPI_SUCCESS, \
- dealii::ExcMPI(error_code))
+#define AssertThrowMPI(error_code) \
+AssertThrow(error_code == MPI_SUCCESS, dealii::ExcMPI(error_code))
#else
#define AssertThrowMPI(error_code) {}
#endif // DEAL_II_WITH_MPI