Reference documentation for deal.II version 9.5.0
|
Enumerations | |
enum class | ExceptionHandling { abort_or_throw_on_exception , throw_on_exception } |
Functions | |
void | abort (const ExceptionBase &exc) noexcept |
template<class ExceptionType > | |
void | issue_error_noreturn (ExceptionHandling handling, const char *file, int line, const char *function, const char *cond, const char *exc_name, ExceptionType e) |
void | do_issue_error_nothrow (const ExceptionBase &e) noexcept |
template<class ExceptionType > | |
void | issue_error_nothrow (const char *file, int line, const char *function, const char *cond, const char *exc_name, ExceptionType e) noexcept |
std::string | get_cusparse_error_string (const cusparseStatus_t error_code) |
std::string | get_cusolver_error_string (const cusolverStatus_t error_code) |
template<typename T , typename U > | |
constexpr bool | compare_for_equality (const T &t, const U &u) |
template<typename T , typename U > | |
constexpr bool | compare_less_than (const T &t, const U &u) |
std::string & | get_additional_assert_output () |
Variables | |
bool | allow_abort_on_exception = true |
bool | show_stacktrace = true |
The functions in this namespace are in connection with the Assert and AssertThrow mechanism but are solely for internal purposes and are not for use outside the exception handling and throwing mechanism.
|
strong |
An enum describing how to treat an exception in issue_error_noreturn.
Enumerator | |
---|---|
abort_or_throw_on_exception | Abort the program by calling |
throw_on_exception | Throw the exception normally. |
Definition at line 1393 of file exceptions.h.
|
noexcept |
Abort the program by printing the error message provided by exc
and calling std::abort()
.
Definition at line 460 of file exceptions.cc.
void deal_II_exceptions::internals::issue_error_noreturn | ( | ExceptionHandling | handling, |
const char * | file, | ||
int | line, | ||
const char * | function, | ||
const char * | cond, | ||
const char * | exc_name, | ||
ExceptionType | e | ||
) |
This routine does the main work for the exception generation mechanism used in the Assert
and AssertThrow
macros: as the name implies, this function either ends by throwing an exception (if handling
is ExceptionHandling::throw_on_exception, or handling
is try_abort_exception and deal_II_exceptions::disable_abort_on_exception is false) or with a call to abort
(if handling
is try_abort_exception and deal_II_exceptions::disable_abort_on_exception is true).
The actual exception object (the last argument) is typically an unnamed object created in place; because we modify it, we can't take it by const reference, and temporaries don't bind to non-const references. So take it by value (=copy it) with a templated type to avoid slicing – the performance implications are pretty minimal anyway.
Definition at line 1426 of file exceptions.h.
|
noexcept |
Internal function that does the work of issue_error_nothrow.
Definition at line 506 of file exceptions.cc.
|
noexcept |
Exception generation mechanism in case we must not throw.
Definition at line 1476 of file exceptions.h.
std::string deal_II_exceptions::internals::get_cusparse_error_string | ( | const cusparseStatus_t | error_code | ) |
Return a string given an error code. This is similar to the cudaGetErrorString function but there is no equivalent function for cuSPARSE.
Definition at line 523 of file exceptions.cc.
std::string deal_II_exceptions::internals::get_cusolver_error_string | ( | const cusolverStatus_t | error_code | ) |
Return a string given an error code. This is similar to the cudaGetErrorString function but there is no equivalent function for cuSOLVER.
Definition at line 569 of file exceptions.cc.
|
inlineconstexpr |
A function that compares two values for equality, after converting to a common type to avoid compiler warnings when comparing objects of different types (e.g., unsigned and signed variables).
Definition at line 1744 of file exceptions.h.
|
inlineconstexpr |
A function that compares two values with operator<
, after converting to a common type to avoid compiler warnings when comparing objects of different types (e.g., unsigned and signed variables).
Definition at line 1758 of file exceptions.h.
std::string & deal_II_exceptions::internals::get_additional_assert_output | ( | ) |
Definition at line 51 of file exceptions.cc.
bool deal_II_exceptions::internals::allow_abort_on_exception = true |
Setting this variable to false will disable deal.II's exception mechanism to abort the problem. The Assert() macro will throw the exception instead and the AssertNothrow() macro will just print the error message. This variable should not be changed directly. Use disable_abort_on_exception() instead.
Definition at line 59 of file exceptions.cc.
bool deal_II_exceptions::internals::show_stacktrace = true |
Definition at line 57 of file exceptions.cc.