|
870 | 870 | * This macro is first used in step-7, where we show another example of |
871 | 871 | * a context where it is frequently used. |
872 | 872 | */ |
873 | | -#if DEAL_II_KOKKOS_VERSION_GTE(3, 6, 0) |
874 | | -# define DEAL_II_ASSERT_UNREACHABLE() \ |
875 | | - Kokkos::abort("ASSERT_UNREACHABLE reached."); |
876 | | -#else |
877 | | -# define DEAL_II_ASSERT_UNREACHABLE() \ |
878 | | - ::dealii::deal_II_exceptions::internals::issue_error_noreturn( \ |
879 | | - ::dealii::deal_II_exceptions::internals::ExceptionHandling:: \ |
880 | | - abort_or_throw_on_exception, \ |
881 | | - __FILE__, \ |
882 | | - __LINE__, \ |
883 | | - __PRETTY_FUNCTION__, \ |
884 | | - nullptr, \ |
885 | | - nullptr, \ |
886 | | - ::dealii::StandardExceptions::ExcMessage( \ |
887 | | - "The program has hit a line of code that the programmer " \ |
888 | | - "marked with the macro DEAL_II_ASSERT_UNREACHABLE() to " \ |
889 | | - "indicate that the program should never reach this " \ |
890 | | - "location. You will have to find out (best done in a " \ |
891 | | - "debugger) why that happened. Typical reasons include " \ |
892 | | - "passing invalid arguments to functions (for example, if " \ |
893 | | - "a function takes an 'enum' with two possible values " \ |
894 | | - "as argument, but you call the function with a third " \ |
895 | | - "value), or if the programmer of the code that triggered " \ |
896 | | - "the error believed that a variable can only have " \ |
897 | | - "specific values, but either that assumption is wrong " \ |
898 | | - "or the computation of that value is buggy." \ |
899 | | - "\n\n" \ |
900 | | - "In those latter conditions, where some internal " \ |
901 | | - "assumption is not satisfied, there may not be very " \ |
902 | | - "much you can do if you encounter such an exception, " \ |
903 | | - "since it indicates an error in deal.II, not in your " \ |
904 | | - "own program. If that is the situation you encounter, " \ |
905 | | - "try to come up with " \ |
906 | | - "the smallest possible program that still demonstrates " \ |
907 | | - "the error and contact the deal.II mailing lists with it " \ |
908 | | - "to obtain help.")) |
909 | | -#endif |
| 873 | +#define DEAL_II_ASSERT_UNREACHABLE() \ |
| 874 | + ::dealii::deal_II_exceptions::internals::do_unreachable( \ |
| 875 | + __FILE__, \ |
| 876 | + __LINE__, \ |
| 877 | + __PRETTY_FUNCTION__, \ |
| 878 | + "The program has hit a line of code that the programmer " \ |
| 879 | + "marked with the macro DEAL_II_ASSERT_UNREACHABLE() to " \ |
| 880 | + "indicate that the program should never reach this " \ |
| 881 | + "location. You will have to find out (best done in a " \ |
| 882 | + "debugger) why that happened. Typical reasons include " \ |
| 883 | + "passing invalid arguments to functions (for example, if " \ |
| 884 | + "a function takes an 'enum' with two possible values " \ |
| 885 | + "as argument, but you call the function with a third " \ |
| 886 | + "value), or if the programmer of the code that triggered " \ |
| 887 | + "the error believed that a variable can only have " \ |
| 888 | + "specific values, but either that assumption is wrong " \ |
| 889 | + "or the computation of that value is buggy." \ |
| 890 | + "\n\n" \ |
| 891 | + "In those latter conditions, where some internal " \ |
| 892 | + "assumption is not satisfied, there may not be very " \ |
| 893 | + "much you can do if you encounter such an exception, " \ |
| 894 | + "since it indicates an error in deal.II, not in your " \ |
| 895 | + "own program. If that is the situation you encounter, " \ |
| 896 | + "try to come up with " \ |
| 897 | + "the smallest possible program that still demonstrates " \ |
| 898 | + "the error and contact the deal.II mailing lists with it " \ |
| 899 | + "to obtain help.") |
910 | 900 |
|
911 | 901 | /** |
912 | 902 | * Special assertion for dimension mismatch. |
|
0 commit comments